Make sure cmdline config file exists (#1348304)

If the --config file doesn't exist lorax will fall back to its defaults,
which are probably not what you want. Now it will exit if it doesn't
exist.
This commit is contained in:
Brian C. Lane 2016-06-20 12:03:14 -07:00
parent 5ef7c093b1
commit 748259619b
1 changed files with 2 additions and 0 deletions

View File

@ -64,6 +64,8 @@ def main():
os.makedirs(os.path.dirname(opts.logfile))
if opts.sharedir and not os.path.isdir(opts.sharedir):
parser.error("sharedir %s doesn't exist." % opts.sharedir)
if opts.config and not os.path.exists(opts.config):
parser.error("config file %s doesn't exist." % opts.config)
setup_logging(opts)