Handle optional arguments for run_forever()

All the other daemons do this, and since the out deamon wrapper
scripts pass all the command line options through directly, seems
simple enough to handle them by ignoring.

This is also applied to run_once().

Change-Id: I1df83bdf78f0dc3d911019f67f78301967b5da72
Closes-Bug: #1253891
Signed-off-by: Peter Portante <peter.portante@redhat.com>
This commit is contained in:
Peter Portante 2013-11-22 00:37:11 -05:00
parent c850580566
commit 4ed1c8473f
2 changed files with 4 additions and 4 deletions
swift/container
test/unit/container

@ -147,7 +147,7 @@ class ContainerSync(Daemon):
swift.common.db.DB_PREALLOCATION = \
config_true_value(conf.get('db_preallocation', 'f'))
def run_forever(self):
def run_forever(self, *args, **kwargs):
"""
Runs container sync scans until stopped.
"""
@ -167,7 +167,7 @@ class ContainerSync(Daemon):
if elapsed < self.interval:
sleep(self.interval - elapsed)
def run_once(self):
def run_once(self, *args, **kwargs):
"""
Runs a single container sync scan.
"""

@ -144,7 +144,7 @@ class TestContainerSync(unittest.TestCase):
cs = sync.ContainerSync({}, container_ring=FakeRing(),
object_ring=FakeRing())
sync.audit_location_generator = fake_audit_location_generator
cs.run_forever()
cs.run_forever(1, 2, a=3, b=4, verbose=True)
except Exception as err:
if str(err) != 'we are now done':
raise
@ -199,7 +199,7 @@ class TestContainerSync(unittest.TestCase):
cs = sync.ContainerSync({}, container_ring=FakeRing(),
object_ring=FakeRing())
sync.audit_location_generator = fake_audit_location_generator
cs.run_once()
cs.run_once(1, 2, a=3, b=4, verbose=True)
self.assertEquals(time_calls, [6])
self.assertEquals(audit_location_generator_calls, [1])
self.assertEquals(cs.reported, 3602)