diff options
author | 2018-06-25 16:32:19 -0400 | |
---|---|---|
committer | 2018-06-25 16:32:19 -0400 | |
commit | 44dfdc8b645cb2d13fa0e966bfa7f7591119c980 (patch) | |
tree | 6c437f534969d841c1ed9c3438f3a0fa8695ae69 | |
parent | grs/Kernel.py: look for firmware-dir in portage_configroot (diff) | |
download | grss-44dfdc8b645cb2d13fa0e966bfa7f7591119c980.tar.gz grss-44dfdc8b645cb2d13fa0e966bfa7f7591119c980.tar.bz2 grss-44dfdc8b645cb2d13fa0e966bfa7f7591119c980.zip |
grs/Constants.py: add CONFIGFILE for an alt to '/etc/grs/systems.conf'
-rw-r--r-- | grs/Constants.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/grs/Constants.py b/grs/Constants.py index ecbac40..bdaee25 100644 --- a/grs/Constants.py +++ b/grs/Constants.py @@ -57,6 +57,12 @@ class Constants(): """ def __init__(self, configfile='/etc/grs/systems.conf'): + # Grab an alternative config file from the env var CONFIGFILE + # TODO: I've designed myself into a bit of a corner here, and + # there is no easy way of adding a command line option to grsrun + # or grsup which propagates to this class. + if 'CONFIGFILE' in os.environ: + configfile = os.environ['CONFIGFILE'] # If there's no config file, we're dead in the water. if not os.path.isfile(configfile): raise Exception('Configuration file %s not found\n' % configfile) |