diff options
author | Chuck Thier <cthier@gmail.com> | 2010-08-24 13:41:58 +0000 |
---|---|---|
committer | Chuck Thier <cthier@gmail.com> | 2010-08-24 13:41:58 +0000 |
commit | c62707ae72ebeb7da99e7622f889a66ae5d7fc79 (patch) | |
tree | 342cdae753ff614471784f4273ca6fb4c3ad7e7d /bin/swift-account-replicator | |
parent | 85e043e9a2823eea48b95c0bbe5cc811af9fb79e (diff) | |
download | swift-c62707ae72ebeb7da99e7622f889a66ae5d7fc79.tar.gz |
Refactored logging configuration so that it has sane defaults
Diffstat (limited to 'bin/swift-account-replicator')
-rwxr-xr-x | bin/swift-account-replicator | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/bin/swift-account-replicator b/bin/swift-account-replicator index 284c75159..18bea931a 100755 --- a/bin/swift-account-replicator +++ b/bin/swift-account-replicator @@ -32,22 +32,11 @@ if __name__ == '__main__': optlist, args = getopt.getopt(sys.argv[1:], '', ['once']) if not args: - print "Usage: account-replicator <--once> CONFIG_FILE [once]" + print "Usage: swift-account-replicator <--once> CONFIG_FILE [once]" sys.exit() - c = ConfigParser() - if not c.read(args[0]): - print "Unable to read config file." - sys.exit(1) once = len(args) > 1 and args[1] == 'once' - - if c.has_section('account-replicator'): - conf = dict(c.items('account-replicator')) - else: - print "Unable to find account-replicator config section in %s." % \ - args[0] - sys.exit(1) - + conf = utils.readconf(sys.argv[1], 'account-replicator') utils.drop_privileges(conf.get('user', 'swift')) if once or '--once' in [opt[0] for opt in optlist]: AccountReplicator(conf).replicate_once() |