]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: policy: add_to_iam_env allows empty values
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 20 Oct 2017 14:27:37 +0000 (16:27 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 22 Jan 2018 13:47:33 +0000 (14:47 +0100)
Since null conditional just allows for presence of a header it makes
sense to allow empty values as well for checking presence of a header

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_op.cc

index f054e461bf394e57913183eb5d907ca24eb72074..187f46d1ad17cd5e31f3eaa752fab7956305a738 100644 (file)
@@ -573,7 +573,6 @@ void rgw_add_to_iam_environment(rgw::IAM::Environment& e, std::string&& key, std
 }
 
 void rgw_add_to_iam_environment(rgw::IAM::Environment& e, const std::string& key, const std::string& val){
-  if (!val.empty())
     e[key] = val;
 }
 
@@ -584,15 +583,13 @@ void rgw_add_to_iam_environment(rgw::IAM::Environment& e, const char* key, const
 }
 
 static int rgw_iam_add_tags_from_bl(struct req_state* s, bufferlist& bl){
-  int op_ret;
   RGWObjTags tagset;
   try {
     auto bliter = bl.begin();
     tagset.decode(bliter);
   } catch (buffer::error& err) {
     ldout(s->cct,0) << "ERROR: caught buffer::error, couldn't decode TagSet" << dendl;
-    op_ret= -EIO;
-    return op_ret;
+    return -EIO;
   }
 
   for (const auto& tag: tagset.get_tags()){