From bb3553d08428c2d2ea0a7d4029a3fecb97678446 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Fri, 16 Mar 2018 18:17:59 -0700 Subject: [PATCH] Use state when you have it ... but either way works. Change-Id: Ib66ee035229d0718b68450587550176c91ce9ca6 Related-Change-Id: Ic108f5c38f700ac4c7bcf8315bf4c55306951361 --- swift/common/db_replicator.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py index 0ef17094fa..0e534ff934 100644 --- a/swift/common/db_replicator.py +++ b/swift/common/db_replicator.py @@ -656,12 +656,11 @@ class Replicator(Daemon): return match.groups()[0] return "UNKNOWN" - def _partition_dir_filter(self, device_id, handoffs_only, - partitions_to_replicate): + def _partition_dir_filter(self, device_id, partitions_to_replicate): def filt(partition_dir): partition = int(partition_dir) - if handoffs_only: + if self.handoffs_only: primary_node_ids = [ d['id'] for d in self.ring.get_part_nodes(partition)] if device_id in primary_node_ids: @@ -722,8 +721,7 @@ class Replicator(Daemon): if os.path.isdir(datadir): self._local_device_ids.add(node['id']) part_filt = self._partition_dir_filter( - node['id'], self.handoffs_only, - partitions_to_replicate) + node['id'], partitions_to_replicate) dirs.append((datadir, node['id'], part_filt)) if not found_local: self.logger.error("Can't find itself %s with port %s in ring "