Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

iar_mods
Justin Clark-Casey (justincc) 2011-11-23 21:10:50 +00:00
commit 617f139aac
4 changed files with 30 additions and 3 deletions

View File

@ -70,7 +70,7 @@ namespace OpenSim
/// <param name="networkInfo"></param> /// <param name="networkInfo"></param>
/// <returns>A configuration that gets passed to modules</returns> /// <returns>A configuration that gets passed to modules</returns>
public OpenSimConfigSource LoadConfigSettings( public OpenSimConfigSource LoadConfigSettings(
IConfigSource argvSource, out ConfigSettings configSettings, IConfigSource argvSource, EnvConfigSource envConfigSource, out ConfigSettings configSettings,
out NetworkServersInfo networkInfo) out NetworkServersInfo networkInfo)
{ {
m_configSettings = configSettings = new ConfigSettings(); m_configSettings = configSettings = new ConfigSettings();
@ -195,6 +195,24 @@ namespace OpenSim
// Make sure command line options take precedence // Make sure command line options take precedence
m_config.Source.Merge(argvSource); m_config.Source.Merge(argvSource);
IConfig enVars = m_config.Source.Configs["Environment"];
if( enVars != null )
{
string[] env_keys = enVars.GetKeys();
foreach ( string key in env_keys )
{
envConfigSource.AddEnv(key, string.Empty);
}
envConfigSource.LoadEnv();
m_config.Source.Merge(envConfigSource);
m_config.Source.ExpandKeyValues();
}
ReadConfigSettings(); ReadConfigSettings();
return m_config; return m_config;

View File

@ -108,6 +108,13 @@ namespace OpenSim
get { return m_clientServers; } get { return m_clientServers; }
} }
protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource();
public EnvConfigSource envConfigSource
{
get { return m_EnvConfigSource; }
}
protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>(); protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
public uint HttpServerPort public uint HttpServerPort
@ -142,7 +149,7 @@ namespace OpenSim
protected virtual void LoadConfigSettings(IConfigSource configSource) protected virtual void LoadConfigSettings(IConfigSource configSource)
{ {
m_configLoader = new ConfigurationLoader(); m_configLoader = new ConfigurationLoader();
m_config = m_configLoader.LoadConfigSettings(configSource, out m_configSettings, out m_networkServersInfo); m_config = m_configLoader.LoadConfigSettings(configSource, envConfigSource, out m_configSettings, out m_networkServersInfo);
ReadExtraConfigSettings(); ReadExtraConfigSettings();
} }

View File

@ -109,11 +109,13 @@ namespace OpenSim.Tests
// Prepare call to ConfigurationLoader.LoadConfigSettings() // Prepare call to ConfigurationLoader.LoadConfigSettings()
ConfigurationLoader cl = new ConfigurationLoader(); ConfigurationLoader cl = new ConfigurationLoader();
IConfigSource argvSource = new IniConfigSource(); IConfigSource argvSource = new IniConfigSource();
EnvConfigSource envConfigSource = new EnvConfigSource();
argvSource.AddConfig("Startup").Set("inifile", mainIniFile); argvSource.AddConfig("Startup").Set("inifile", mainIniFile);
ConfigSettings configSettings; ConfigSettings configSettings;
NetworkServersInfo networkInfo; NetworkServersInfo networkInfo;
OpenSimConfigSource source = cl.LoadConfigSettings(argvSource, out configSettings, out networkInfo); OpenSimConfigSource source = cl.LoadConfigSettings(argvSource, envConfigSource,
out configSettings, out networkInfo);
// Remove default config // Remove default config
config = source.Source.Configs["Startup"]; config = source.Source.Configs["Startup"];

Binary file not shown.