Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008560opensim[REGION] OpenSim Corepublic2019-07-11 04:452019-07-31 18:43
ReporterTyphaineArtez 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version0.9.0.1 
Target VersionFixed in Version 
Summary0008560: Include directives do not take environment variables expansion
DescriptionDoing some overlaying configuration scheme, I discovered the Opensim configuration system does not use environment variable expansion to resolve included files (which is really handy to make a generic configuration scheme, for example putting in a folder with Opensim instance name a local ini file to overwrite global settings).

Checking the code, I found in Opensim/Region/Application/ConfigurationLoader.cs, line 239, that :
    string file = config.GetString(k);
could be replaced by :
    string file = config.GetExpanded(k);

Method referenced at http://nini.sourceforge.net/Reference/html/Nini.Config.IConfig.GetExpanded.html [^]

I could not test myself as I never compiled Opensim and have not the correct environment to do so (in my todo list)
Steps To ReproduceIn main Opensim, Add an [Environment] section
In this section, reference an environment variable
Add a new Include directive to use that environment variable to resolve the path of the included file.

[Environment]
  CONFDIR = ""

[Includes]
  Include-Local = "${Environment|CONFDIR}/Local.ini
TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region)
Physics EngineBulletSim
EnvironmentMono / Linux64
Mono Version5.x
Viewer
Attached Files

- Relationships

-  Notes
(0035468)
TyphaineArtez (reporter)
2019-07-11 06:57
edited on: 2019-07-11 06:57

It seems the way environment variables are expanded (after reading the whole config files) does not match the solution given in my initial post.

I tried to compile and apply the fix, and the reference to the environment variable is expanded to the empty string.

I don't know enough how all this works to make a more complex fix.

(0035522)
UbitUmarov (administrator)
2019-07-31 07:30

Thanks for the try and sharing anyways
I may look to this sometime in future
(0035532)
tampa (reporter)
2019-07-31 18:43

You can override variables if you make sure they are loaded last. For this define a custom file that isn't an ini and place your variable in startup section. I tried this along with setting dynamic, at runtime, variables, unfortunately that part would not work, but what you try to do there should work this way.

- Issue History
Date Modified Username Field Change
2019-07-11 04:45 TyphaineArtez New Issue
2019-07-11 06:57 TyphaineArtez Note Added: 0035468
2019-07-11 06:57 TyphaineArtez Note Edited: 0035468 View Revisions
2019-07-31 07:30 UbitUmarov Note Added: 0035522
2019-07-31 18:43 tampa Note Added: 0035532


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker