From: Danny Al-Gaaf Date: Mon, 12 May 2014 00:01:10 +0000 (+0200) Subject: rgw_user.cc: cleanup RGWAccessKeyPool::check_op() X-Git-Tag: v0.81~27^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b1196795c20bc2e302b019efa1626181f0dad552;p=ceph.git rgw_user.cc: cleanup RGWAccessKeyPool::check_op() 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 --- diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index ceede64b437..41954b042fc 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -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; }