Trying to guestimate sensible default values for GridInfoService if no
[GridInfo] section is supplied by OpenSim.ini; also adding log warning if that is the case.0.6.0-stable
parent
f69ae29e39
commit
0512895eea
|
@ -65,17 +65,37 @@ namespace OpenSim.Common.Communications
|
|||
IConfigSource _configSource = new IniConfigSource(configPath);
|
||||
IConfig startupCfg = _configSource.Configs["Startup"];
|
||||
IConfig gridCfg = _configSource.Configs["GridInfo"];
|
||||
IConfig netCfg = _configSource.Configs["Network"];
|
||||
|
||||
if (!startupCfg.GetBoolean("gridmode", false))
|
||||
_info["mode"] = "standalone";
|
||||
else
|
||||
bool grid = startupCfg.GetBoolean("gridmode", false);
|
||||
|
||||
if (grid)
|
||||
_info["mode"] = "grid";
|
||||
else
|
||||
_info["mode"] = "standalone";
|
||||
|
||||
|
||||
if (null != gridCfg)
|
||||
{
|
||||
foreach (string k in gridCfg.GetKeys())
|
||||
{
|
||||
_info[k] = gridCfg.GetString(k);
|
||||
}
|
||||
}
|
||||
else if (null != netCfg)
|
||||
{
|
||||
if (grid)
|
||||
_info["login"] = netCfg.GetString("user_server_url");
|
||||
else
|
||||
_info["login"] = String.Format("http://127.0.0.1:{0}/", netCfg.GetString("http_listener_port"));
|
||||
IssueWarning();
|
||||
}
|
||||
else
|
||||
{
|
||||
_info["login"] = "http://127.0.0.1:9000/";
|
||||
IssueWarning();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_log.DebugFormat("[GridInfoService] cannot get grid info from {0}, using minimal defaults", configPath);
|
||||
|
@ -91,6 +111,16 @@ namespace OpenSim.Common.Communications
|
|||
{
|
||||
}
|
||||
|
||||
private void IssueWarning()
|
||||
{
|
||||
_log.Warn("[GridInfoService] found no [GridInfo] section in your OpenSim.ini");
|
||||
_log.Warn("[GridInfoService] trying to guess sensible defaults, you might want to provide better ones:");
|
||||
foreach (string k in _info.Keys)
|
||||
{
|
||||
_log.WarnFormat("[GridInfoService] {0}: {1}", k, _info[k]);
|
||||
}
|
||||
}
|
||||
|
||||
public XmlRpcResponse XmlRpcGridInfoMethod(XmlRpcRequest request)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
|
|
Loading…
Reference in New Issue