From: Ali Masarwa Date: Sun, 23 Mar 2025 11:31:38 +0000 (+0200) Subject: RGW|Bucket Notification: fix for v2 topics rgw-admin list operation X-Git-Tag: v19.2.3~78^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6839d2d5af2e26d693f57b59faec5db5d05549ba;p=ceph.git RGW|Bucket Notification: fix for v2 topics rgw-admin list operation Signed-off-by: Ali Masarwa (cherry picked from commit 3f0428a017cdf35b7290cf7836eb4baa4eb0e774) Conflicts: src/test/rgw/bucket_notification/api.py src/test/rgw/bucket_notification/test_bn.py --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index a6b0812315d..b02b0f5c063 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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); } diff --git a/src/test/rgw/bucket_notification/api.py b/src/test/rgw/bucket_notification/api.py index e7ec31f1711..63b1ec69977 100644 --- a/src/test/rgw/bucket_notification/api.py +++ b/src/test/rgw/bucket_notification/api.py @@ -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) diff --git a/src/test/rgw/bucket_notification/test_bn.py b/src/test/rgw/bucket_notification/test_bn.py index 23a2f840261..44aefd38f4e 100644 --- a/src/test/rgw/bucket_notification/test_bn.py +++ b/src/test/rgw/bucket_notification/test_bn.py @@ -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 """