Reference the conf has in Lorax rather than globally.

This commit is contained in:
David Cantrell 2008-10-09 21:46:41 -10:00
parent 1df9b5beaa
commit 3377bc22e4

View File

@ -48,7 +48,7 @@ def usage(prog):
if __name__ == "__main__": if __name__ == "__main__":
prog = os.path.basename(sys.argv[0]) prog = os.path.basename(sys.argv[0])
opts, args, mirrorlist, extrarepos = [], [], [], [] opts, args, mirrorlist, extrarepos = [], [], [], []
version, product, release, output, repo = None, None, None, None, None confdir, version, product, release, output, repo = None, None, None, None, None, None
debug = False debug = False
cleanup = False cleanup = False
variant, updates = '', '' variant, updates = '', ''
@ -85,7 +85,7 @@ if __name__ == "__main__":
mirrorlist.append(a) mirrorlist.append(a)
elif o in ('-c', '--confdir'): elif o in ('-c', '--confdir'):
if os.path.isdir(a): if os.path.isdir(a):
pylorax.conf['confdir'] = a confdir = a
else: else:
sys.stderr.write("ERROR: %s is not a directory.\n" % (a,)) sys.stderr.write("ERROR: %s is not a directory.\n" % (a,))
elif o in ('-C', '--cleanup'): elif o in ('-C', '--cleanup'):
@ -103,6 +103,10 @@ if __name__ == "__main__":
sys.exit(1) sys.exit(1)
lorax = pylorax.Lorax(repos=args, output=output, mirrorlist=mirrorlist) lorax = pylorax.Lorax(repos=args, output=output, mirrorlist=mirrorlist)
if confdir is not None:
lorax.conf['confdir'] = confdir
lorax.run() lorax.run()
if cleanup: if cleanup: