]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_user.cc: cleanup RGWAccessKeyPool::check_op()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 12 May 2014 00:01:10 +0000 (02:01 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 12 May 2014 00:01:10 +0000 (02:01 +0200)
Remove dead assignment and unsued variable 'secret_key'. Check
op_state.get_access_key() directly for emptiness without extra
variable. Fix comment above check for access key.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_user.cc

index ceede64b43736a814645edd44cf4a405e33f2eb5..41954b042fc6f9ebc3e538f305722066ec2025c8 100644 (file)
@@ -737,9 +737,6 @@ int RGWAccessKeyPool::check_op(RGWUserAdminOpState& op_state,
     return -EACCES;
   }
 
-  std::string access_key = op_state.get_access_key();
-  std::string secret_key = op_state.get_secret_key();
-
   int32_t key_type = op_state.get_key_type();
 
   // if a key type wasn't specified set it to s3
@@ -748,8 +745,9 @@ int RGWAccessKeyPool::check_op(RGWUserAdminOpState& op_state,
 
   op_state.set_key_type(key_type);
 
-  /* see if the access key or secret key was specified */
-  if (key_type == KEY_TYPE_S3 && !op_state.will_gen_access() && access_key.empty()) {
+  /* see if the access key was specified */
+  if (key_type == KEY_TYPE_S3 && !op_state.will_gen_access() && 
+      op_state.get_access_key().empty()) {
     set_err_msg(err_msg, "empty access key");
     return -EINVAL;
   }