]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: pubsub: list events returns empty list if bucket doesn't exist
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 24 Sep 2018 23:53:37 +0000 (16:53 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 11 Dec 2018 08:10:43 +0000 (00:10 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_pubsub.cc

index 412aea2cf540fe893afc4409956b718de56ef832..6b94a22a699feeea899c9b6b8c24fd311aba8379 100644 (file)
@@ -409,6 +409,10 @@ int RGWUserPubSub::Sub::list_events(const string& marker, int max_events,
   string tenant;
   RGWObjectCtx obj_ctx(store);
   ret = store->get_bucket_info(obj_ctx, tenant, sub_conf.dest.bucket_name, bucket_info, nullptr, nullptr);
+  if (ret == -ENOENT) {
+    result->is_truncated = false;
+    return 0;
+  }
   if (ret < 0) {
     ldout(store->ctx(), 0) << "ERROR: failed to read bucket info for events bucket: bucket=" << sub_conf.dest.bucket_name << " ret=" << ret << dendl;
     return ret;