OPEN-7: allow specification of the config-file with env var AUTOBUILD_CONFIG_FILE
Review Request #140 - Created Feb. 6, 2011 and submitted
Oz Linden | Reviewers | ||
viewer | |||
open-7 | |||
None | autobuild |
This change allows the environment variable AUTOBUILD_CONFIG_FILE to specify a default config-file, so that the precedence becomes: 1. the --config-file command line option 2. the environment variable AUTOBUILD_CONFIG_FILE 3. "autobuild.xml" It also adds an info-level (--verbose) display of the config file name that is being loaded, and a warning level display if the config file does not exist.
Manually tested with and without the command line option, and with and without the environment variable set: confirmed that the correct file name is used per the precedence above. Confirmed that the new logging works correctly.
Posted (Feb. 8, 2011, 9:48 a.m.)
Should AUTOBUILD_CONFIG_FILE be renamed to AUTOBUILD_CONFIG_FILENAME to clarify this is a name and not a full file path? Not sure what would happen if someone set AUTOBUILD_CONFIG_FILE=foo/bar/baz/MyAutobuildConfig.xml, but probably not what the user expects.
-
autobuild/configfile.py (Diff revision 1) -
This gets called once on package load. I guess that's fine as long as you just use autobuild through the autobuild script, but you might get unexpected results if you are calling autobuild functions in your own interactive python session. Admittedly that's a corner case...
-
autobuild/configfile.py (Diff revision 1) -
This isn't a warning. It is perfectly OK to run autobuild with no script file, like, for example when you call autobuild edit to begin configuring an autobuild package.
Other reviews