From: Arjun Sharma Date: Tue, 27 Jul 2021 09:34:06 +0000 (+0530) Subject: rgw/notification: assigning the value of zonegroup to awsRegion X-Git-Tag: v17.1.0~349^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43915774b90caa473307b5e04aeb88bc451d2226;p=ceph.git rgw/notification: assigning the value of zonegroup to awsRegion Signed-off-by: Arjun Sharma --- diff --git a/src/rgw/rgw_notify.cc b/src/rgw/rgw_notify.cc index 428c7174c01c..65b7a84d9fec 100644 --- a/src/rgw/rgw_notify.cc +++ b/src/rgw/rgw_notify.cc @@ -689,6 +689,7 @@ void populate_event_from_request(const reservation_t& res, event.object_size = size; event.object_etag = etag; event.object_versionId = version; + event.awsRegion = res.store->get_zone()->get_zonegroup().api_name; // use timestamp as per key sequence id (hex encoded) const utime_t ts(real_clock::now()); boost::algorithm::hex((const char*)&ts, (const char*)&ts + sizeof(utime_t), diff --git a/src/test/rgw/bucket_notification/test_bn.py b/src/test/rgw/bucket_notification/test_bn.py index ec6b74d66171..7d420aa064ae 100644 --- a/src/test/rgw/bucket_notification/test_bn.py +++ b/src/test/rgw/bucket_notification/test_bn.py @@ -827,6 +827,7 @@ def test_ps_s3_notification_filter_on_master(): for event in receiver.get_and_reset_events(): notif_id = event['Records'][0]['s3']['configurationId'] key_name = event['Records'][0]['s3']['object']['key'] + awsRegion = event['Records'][0]['awsRegion'] if notif_id == notification_name+'_1': found_in1.append(key_name) elif notif_id == notification_name+'_2': @@ -841,6 +842,7 @@ def test_ps_s3_notification_filter_on_master(): assert_equal(set(found_in1), set(expected_in1)) assert_equal(set(found_in2), set(expected_in2)) assert_equal(set(found_in3), set(expected_in3)) + assert_equal(awsRegion, zonegroup) if not skip_notif4: assert_equal(set(found_in4), set(expected_in4))