Merge "Change partition name from string to integer"

This commit is contained in:
Zuul 2019-04-09 21:20:50 +00:00 committed by Gerrit Code Review
commit 48a2e5c311
2 changed files with 4 additions and 4 deletions

View File

@ -817,8 +817,8 @@ class ObjectReplicator(Daemon):
self.logger.exception('ERROR creating %s' % obj_path)
continue
for partition in os.listdir(obj_path):
if (override_partitions is not None
and partition not in override_partitions):
if (override_partitions is not None and partition.isdigit()
and int(partition) not in override_partitions):
continue
if (partition.startswith('auditor_status_') and

View File

@ -1401,10 +1401,10 @@ class TestObjectReplicator(unittest.TestCase):
self.assertTrue(os.access(part_path, os.F_OK))
self.replicator.replicate(override_devices=['sdb'])
self.assertTrue(os.access(part_path, os.F_OK))
self.replicator.replicate(override_partitions=['9'])
self.replicator.replicate(override_partitions=[9])
self.assertTrue(os.access(part_path, os.F_OK))
self.replicator.replicate(override_devices=['sda'],
override_partitions=['1'])
override_partitions=[1])
self.assertFalse(os.access(part_path, os.F_OK))
def test_delete_policy_override_params(self):