Merge "object-replicator: Remove some dead code"

This commit is contained in:
Zuul 2022-06-01 19:40:52 +00:00 committed by Gerrit Code Review
commit 22ef393860
2 changed files with 1 additions and 12 deletions

View File

@ -213,17 +213,6 @@ class ObjectReplicator(Daemon):
self.replicator_workers,
os.getpid()))
def _get_my_replication_ips(self):
my_replication_ips = set()
ips = whataremyips()
for policy in self.policies:
self.load_object_ring(policy)
for local_dev in [dev for dev in policy.object_ring.devs
if dev and dev['replication_ip'] in ips and
dev['replication_port'] == self.port]:
my_replication_ips.add(local_dev['replication_ip'])
return list(my_replication_ips)
def _child_process_reaper(self):
"""
Consume processes from self._child_process_reaper_queue and wait() for
@ -951,7 +940,6 @@ class ObjectReplicator(Daemon):
self.last_replication_count = 0
self.replication_cycle = (self.replication_cycle + 1) % 10
self.partition_times = []
self.my_replication_ips = self._get_my_replication_ips()
self.all_devs_info = set()
self.handoffs_remaining = 0

View File

@ -2287,6 +2287,7 @@ class TestObjectReplicator(unittest.TestCase):
def test_replicate_skipped_partpower_increase(self):
_create_test_rings(self.testdir, next_part_power=4)
self.replicator.get_local_devices() # refresh rings
self.replicator.replicate()
self.assertEqual(0, self.replicator.job_count)
self.assertEqual(0, self.replicator.total_stats.attempted)