From 459b9d9e7c8c7c14bedf0c5473325ac44b4230d8 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 26 Feb 2011 19:11:11 -0700 Subject: [PATCH] happinessutil.py: server-vs-tracker cleanup --- src/allmydata/util/happinessutil.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/allmydata/util/happinessutil.py b/src/allmydata/util/happinessutil.py index 9a5d74b2..11d36791 100644 --- a/src/allmydata/util/happinessutil.py +++ b/src/allmydata/util/happinessutil.py @@ -54,7 +54,7 @@ def shares_by_server(servermap): ret.setdefault(peerid, set()).add(shareid) return ret -def merge_peers(servermap, upload_servers=None): +def merge_peers(servermap, upload_trackers=None): """ I accept a dict of shareid -> set(peerid) mappings, and optionally a set of PeerTrackers. If no set of PeerTrackers is provided, I return @@ -66,15 +66,15 @@ def merge_peers(servermap, upload_servers=None): # context where it is okay to do that, make a copy of servermap and # work with it. servermap = deepcopy(servermap) - if not upload_servers: + if not upload_trackers: return servermap assert(isinstance(servermap, dict)) - assert(isinstance(upload_servers, set)) + assert(isinstance(upload_trackers, set)) - for peer in upload_servers: - for shnum in peer.buckets: - servermap.setdefault(shnum, set()).add(peer.serverid) + for tracker in upload_trackers: + for shnum in tracker.buckets: + servermap.setdefault(shnum, set()).add(tracker.serverid) return servermap def servers_of_happiness(sharemap): -- 2.45.2