]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW|Bucket Notification: fix for v2 topics rgw-admin list operation
authorAli Masarwa <amasarwa@redhat.com>
Sun, 23 Mar 2025 11:31:38 +0000 (13:31 +0200)
committerYuval Lifshitz <ylifshit@ibm.com>
Tue, 22 Apr 2025 14:29:14 +0000 (14:29 +0000)
Signed-off-by: Ali Masarwa <amasarwa@redhat.com>
(cherry picked from commit 3f0428a017cdf35b7290cf7836eb4baa4eb0e774)

Conflicts:
src/test/rgw/bucket_notification/api.py
src/test/rgw/bucket_notification/test_bn.py

src/rgw/rgw_admin.cc
src/test/rgw/bucket_notification/api.py
src/test/rgw/bucket_notification/test_bn.py

index a6b0812315d6e24fae791b3a967878a529f7ebef..b02b0f5c06387d6f3ec09e29e80b8c065bd4cf24 100644 (file)
@@ -11087,7 +11087,6 @@ next:
       owner = rgw_account_id{account_id};
     }
 
-    formatter->open_object_section("result");
     rgw_pubsub_topics result;
     if (rgw::all_zonegroups_support(*site, rgw::zone_features::notification_v2) &&
         driver->stat_topics_v1(tenant, null_yield, dpp()) == -ENOENT) {
@@ -11132,7 +11131,6 @@ next:
         encode_json("marker", next_token, formatter.get());
       }
     }
-    formatter->close_section(); // result
     formatter->flush(cout);
   }
 
index e7ec31f17111a318089842206018c68ac3f61cfc..63b1ec699779e593555c37f4d19981f0aecfa914 100644 (file)
@@ -247,13 +247,13 @@ def delete_all_topics(conn, tenant, cluster):
     if tenant == '':
         topics_result = admin(['topic', 'list'], cluster)
         topics_json = json.loads(topics_result[0])
-        for topic in topics_json['topics']:
+        for topic in topics_json:
             rm_result = admin(['topic', 'rm', '--topic', topic['name']], cluster)
             print(rm_result)
     else:
         topics_result = admin(['topic', 'list', '--tenant', tenant], cluster)
         topics_json = json.loads(topics_result[0])
-        for topic in topics_json['topics']:
+        for topic in topics_json:
             rm_result = admin(['topic', 'rm', '--tenant', tenant, '--topic', topic['name']], cluster)
             print(rm_result)
 
index 23a2f840261b4a52e61b05395fe40e243c6466b8..44aefd38f4efadb086bc6b232a9b647c50cff190 100644 (file)
@@ -545,7 +545,7 @@ def list_topics(assert_len=None, tenant=''):
         result = admin(['topic', 'list', '--tenant', tenant], get_config_cluster())
     parsed_result = json.loads(result[0])
     if assert_len:
-        assert_equal(len(parsed_result['topics']), assert_len)
+        assert_equal(len(parsed_result), assert_len)
     return parsed_result
 
 
@@ -5547,7 +5547,6 @@ def test_notification_caching():
     if receiver is not None:
         stop_kafka_receiver(receiver, task)
 
-
 @attr('kafka_test')
 def test_connection_caching():
     """ test connection caching """