mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Add Util method to load OpSys env vars
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
ce5d308d23
commit
6955190c7d
@@ -82,8 +82,7 @@ namespace OpenSim
|
||||
|
||||
List<string> sources = new List<string>();
|
||||
|
||||
string masterFileName =
|
||||
startupConfig.GetString("inimaster", "OpenSimDefaults.ini");
|
||||
string masterFileName = startupConfig.GetString("inimaster", "OpenSimDefaults.ini");
|
||||
|
||||
if (masterFileName == "none")
|
||||
masterFileName = String.Empty;
|
||||
@@ -207,26 +206,13 @@ namespace OpenSim
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
// Merge OpSys env vars
|
||||
m_log.Info("[CONFIG]: Loading environment variables for Config");
|
||||
Util.MergeEnvironmentToConfig(m_config.Source);
|
||||
|
||||
// Make sure command line options take precedence
|
||||
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();
|
||||
|
||||
return m_config;
|
||||
|
||||
Reference in New Issue
Block a user