From cf35829e78054d22fe37b3bcb07dd2a53015c483 Mon Sep 17 00:00:00 2001 From: Chuck Thier Date: Fri, 20 Aug 2010 15:28:02 +0000 Subject: [PATCH] Fixed a couple of typos, and some config things I missed in the object-replicator --- bin/swift-container-auditor | 2 +- bin/swift-object-replicator | 4 ++-- swift/obj/replicator.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/swift-container-auditor b/bin/swift-container-auditor index 6dfdc4592d..b001350039 100755 --- a/bin/swift-container-auditor +++ b/bin/swift-container-auditor @@ -47,7 +47,7 @@ if __name__ == '__main__': logger.critical('UNCAUGHT EXCEPTION', exc_info=exc_info) sys.stdout = sys.stderr = utils.LoggerFileObject(logger) - utils.drop_privileges(onf.get('user', 'swift')) + utils.drop_privileges(conf.get('user', 'swift')) try: os.setsid() diff --git a/bin/swift-object-replicator b/bin/swift-object-replicator index 6a2da4b4f3..2f9c4a63e8 100755 --- a/bin/swift-object-replicator +++ b/bin/swift-object-replicator @@ -32,8 +32,8 @@ if __name__ == '__main__': print "Usage: object-replicator CONFIG_FILE [once]" sys.exit() c = ConfigParser() - if not c.read(conf_file): - print "Unable to read config file: %s" % conf_file + if not c.read(sys.argv[1]): + print "Unable to read config file" sys.exit(1) if c.has_section('object-replicator'): conf = dict(c.items('object-replicator')) diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py index 8848748a94..d59a3ceb4f 100644 --- a/swift/obj/replicator.py +++ b/swift/obj/replicator.py @@ -216,8 +216,8 @@ class ObjectReplicator(object): self.swift_dir = conf.get('swift_dir', '/etc/swift') self.port = int(conf.get('bind_port', 6000)) self.concurrency = int(conf.get('concurrency', 1)) - self.timeout = conf['timeout'] - self.stats_interval = int(conf['stats_interval']) + self.timeout = conf.get('timeout', '5') + self.stats_interval = int(conf.get('stats_interval', '3600')) self.object_ring = Ring(join(self.swift_dir, 'object.ring.gz')) self.ring_check_interval = int(conf.get('ring_check_interval', 15)) self.next_check = time.time() + self.ring_check_interval