]> git-server-git.apps.pok.os.sepia.ceph.com Git - radosgw-agent.git/commitdiff
sync-tool: fix Zone class
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 2 Apr 2015 19:28:57 +0000 (12:28 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 2 Apr 2015 19:29:57 +0000 (12:29 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
radosgw_agent/sync_tool.py

index eab1a64eb80a088945b7928b4930cb4f112cd440..353b1373a32c1af35a975c86c55ac07384852a0a 100644 (file)
@@ -718,36 +718,6 @@ class Object(object):
 
         print dump_json(entries)
 
-class Zone:
-    def __init__(self, sync):
-        self.sync = sync
-
-    def iterate_diff(self, src_buckets):
-        for b in src_buckets:
-            buck = Bucket(b, -1, self.sync)
-
-            markers = buck.get_source_markers()
-
-            for (shard_id, instance) in buck.iterate_shards():
-                try:
-                    bound = buck.get_bound(instance)['marker']
-                except:
-                    bound = None
-
-                try:
-                    marker = markers[shard_id]
-                except:
-                    marker = None
-
-                if markers[shard_id] != bound:
-                    yield b, shard_id, marker, bound
-
-    def iterate_diff_objects(self, bucket, shard_id, marker, bound):
-        if not bound:
-            for obj in client.list_objects_in_bucket(self.sync.src_conn, bucket, shard_id=shard_id):
-                yield obj
-
-
 
 class Zone(object):
     def __init__(self, sync):
@@ -813,6 +783,11 @@ class Zone(object):
                     if len(gens) < concurrent_buckets:
                         break
 
+    def iterate_diff_objects(self, bucket, shard_id, marker, bound):
+        if not bound:
+            for obj in client.list_objects_in_bucket(self.sync.src_conn, bucket, shard_id=shard_id):
+                yield obj
+
 
 
 class SyncToolCommand(object):