From 44dfdc8b645cb2d13fa0e966bfa7f7591119c980 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Mon, 25 Jun 2018 16:32:19 -0400 Subject: grs/Constants.py: add CONFIGFILE for an alt to '/etc/grs/systems.conf' --- grs/Constants.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- cgit v1.2.3-65-gdbad