aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grs/Constants.py6
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)