diff options
author | Dev Random | 2014-02-25 08:24:22 -0500 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-02-26 23:39:45 +0000 |
commit | 6955190c7db2563927bc53fd47ed0b47094be45c (patch) | |
tree | f1194c1d68f79887df86abf766bcad104516879d /OpenSim/Region/Application/ConfigurationLoader.cs | |
parent | Add some regression tests for previous commit 0e23374 (diff) | |
download | opensim-SC-6955190c7db2563927bc53fd47ed0b47094be45c.zip opensim-SC-6955190c7db2563927bc53fd47ed0b47094be45c.tar.gz opensim-SC-6955190c7db2563927bc53fd47ed0b47094be45c.tar.bz2 opensim-SC-6955190c7db2563927bc53fd47ed0b47094be45c.tar.xz |
Add Util method to load OpSys env vars
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/ConfigurationLoader.cs | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 52e520c..06ce145 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -82,8 +82,7 @@ namespace OpenSim | |||
82 | 82 | ||
83 | List<string> sources = new List<string>(); | 83 | List<string> sources = new List<string>(); |
84 | 84 | ||
85 | string masterFileName = | 85 | string masterFileName = startupConfig.GetString("inimaster", "OpenSimDefaults.ini"); |
86 | startupConfig.GetString("inimaster", "OpenSimDefaults.ini"); | ||
87 | 86 | ||
88 | if (masterFileName == "none") | 87 | if (masterFileName == "none") |
89 | masterFileName = String.Empty; | 88 | masterFileName = String.Empty; |
@@ -207,26 +206,13 @@ namespace OpenSim | |||
207 | Environment.Exit(1); | 206 | Environment.Exit(1); |
208 | } | 207 | } |
209 | 208 | ||
209 | // Merge OpSys env vars | ||
210 | m_log.Info("[CONFIG]: Loading environment variables for Config"); | ||
211 | Util.MergeEnvironmentToConfig(m_config.Source); | ||
212 | |||
210 | // Make sure command line options take precedence | 213 | // Make sure command line options take precedence |
211 | m_config.Source.Merge(argvSource); | 214 | m_config.Source.Merge(argvSource); |
212 | 215 | ||
213 | IConfig enVars = m_config.Source.Configs["Environment"]; | ||
214 | |||
215 | if( enVars != null ) | ||
216 | { | ||
217 | string[] env_keys = enVars.GetKeys(); | ||
218 | |||
219 | foreach ( string key in env_keys ) | ||
220 | { | ||
221 | envConfigSource.AddEnv(key, string.Empty); | ||
222 | } | ||
223 | |||
224 | envConfigSource.LoadEnv(); | ||
225 | m_config.Source.Merge(envConfigSource); | ||
226 | } | ||
227 | |||
228 | m_config.Source.ExpandKeyValues(); | ||
229 | |||
230 | ReadConfigSettings(); | 216 | ReadConfigSettings(); |
231 | 217 | ||
232 | return m_config; | 218 | return m_config; |