Skip to content

Instantly share code, notes, and snippets.

@smerritt
Created July 3, 2013 17:59
Show Gist options
  • Save smerritt/5921047 to your computer and use it in GitHub Desktop.
Save smerritt/5921047 to your computer and use it in GitHub Desktop.
diff --git a/swift/obj/auditor.py b/swift/obj/auditor.py
index c672928..4ffb98e 100644
--- a/swift/obj/auditor.py
+++ b/swift/obj/auditor.py
@@ -158,7 +158,8 @@ class AuditorWorker(object):
:param partition: the partition the path is on
"""
try:
- assert isinstance(path, basestring)
+ if not path:
+ return
try:
name = object_server.read_metadata(path)['name']
except (Exception, Timeout) as exc:
diff --git a/test/unit/container/test_sync.py b/test/unit/container/test_sync.py
index dad1fef..d050cb9 100644
--- a/test/unit/container/test_sync.py
+++ b/test/unit/container/test_sync.py
@@ -181,7 +181,7 @@ class TestContainerSync(unittest.TestCase):
def fake_audit_location_generator(*args, **kwargs):
audit_location_generator_calls[0] += 1
# Makes .container_sync() short-circuit
- yield 0, 'device', 'partition'
+ yield None, 'dontcare', 'dontcare'
return
orig_time = sync.time
diff --git a/test/unit/obj/test_auditor.py b/test/unit/obj/test_auditor.py
index 82caba3..092db87 100644
--- a/test/unit/obj/test_auditor.py
+++ b/test/unit/obj/test_auditor.py
@@ -141,12 +141,6 @@ class TestAuditor(unittest.TestCase):
'sda', '0')
self.assertEquals(self.auditor.quarantines, pre_quarantines + 1)
- def test_object_audit_bad_args(self):
- self.auditor = auditor.AuditorWorker(self.conf, self.logger)
- pre_errors = self.auditor.errors
- self.auditor.object_audit(5, 'sda', '0')
- self.assertEquals(self.auditor.errors, pre_errors + 1)
-
def test_object_run_once_pass(self):
self.auditor = auditor.AuditorWorker(self.conf, self.logger)
self.auditor.log_time = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment