removed: required config file
This commit is contained in:
parent
0892f3920e
commit
417c78a15d
@ -32,7 +32,7 @@ def main(argv=None):
|
||||
parser = argparse.ArgumentParser(description=('Parallel remote command'
|
||||
' execution and file'
|
||||
' collection tool'))
|
||||
parser.add_argument('--config', default='config.yaml',
|
||||
parser.add_argument('--config',
|
||||
help='config file')
|
||||
parser.add_argument('-o', '--dest-file',
|
||||
help='output archive file')
|
||||
@ -60,7 +60,9 @@ def main(argv=None):
|
||||
loglevel = logging.INFO
|
||||
logging.basicConfig(level=loglevel,
|
||||
format='%(asctime)s %(levelname)s %(message)s')
|
||||
config = Conf.load_conf(args.config)
|
||||
config = Conf()
|
||||
if args.config:
|
||||
config = Conf.load_conf(args.config)
|
||||
main_arc = os.path.join(config.archives, 'general.tar.bz2')
|
||||
if args.dest_file:
|
||||
main_arc = args.dest_file
|
||||
|
@ -36,6 +36,7 @@ class Conf(object):
|
||||
try:
|
||||
with open(filename, 'r') as f:
|
||||
conf = yaml.load(f)
|
||||
return Conf(**conf)
|
||||
except IOError as e:
|
||||
logging.error("load_conf: I/O error(%s): %s" % (e.errno, e.strerror))
|
||||
sys.exit(1)
|
||||
@ -48,8 +49,9 @@ class Conf(object):
|
||||
except:
|
||||
logging.error("load_conf: Unexpected error: %s" % sys.exc_info()[0])
|
||||
sys.exit(1)
|
||||
logging.info(conf)
|
||||
return Conf(**conf)
|
||||
finally:
|
||||
logging.error("load_conf: exiting...")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user