]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw: use version_id from key directly
authorCasey Bodley <cbodley@redhat.com>
Thu, 24 May 2018 19:13:05 +0000 (15:13 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 28 Jan 2019 14:35:40 +0000 (09:35 -0500)
now that PutObj returns the x-amz-version-id, it's available through
Key.version_id without resorting to Bucket.list_versions()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/test/rgw/rgw_multi/tests.py

index a6b1152705ab87e50d213d89bb5feb08884a144c..8d692470acfcad6e4a5c3565d64ba78f2194c4cd 100644 (file)
@@ -675,22 +675,19 @@ def test_versioned_object_incremental_sync():
             k = new_key(zone_conn, bucket, obj)
 
             k.set_contents_from_string('version1')
-            v = get_latest_object_version(k)
-            log.debug('version1 id=%s', v.version_id)
+            log.debug('version1 id=%s', k.version_id)
             # don't delete version1 - this tests that the initial version
             # doesn't get squashed into later versions
 
             # create and delete the following object versions to test that
             # the operations don't race with each other during sync
             k.set_contents_from_string('version2')
-            v = get_latest_object_version(k)
-            log.debug('version2 id=%s', v.version_id)
-            k.bucket.delete_key(obj, version_id=v.version_id)
+            log.debug('version2 id=%s', k.version_id)
+            k.bucket.delete_key(obj, version_id=k.version_id)
 
             k.set_contents_from_string('version3')
-            v = get_latest_object_version(k)
-            log.debug('version3 id=%s', v.version_id)
-            k.bucket.delete_key(obj, version_id=v.version_id)
+            log.debug('version3 id=%s', k.version_id)
+            k.bucket.delete_key(obj, version_id=k.version_id)
 
     for _, bucket in zone_bucket:
         zonegroup_bucket_checkpoint(zonegroup_conns, bucket.name)