From b1196795c20bc2e302b019efa1626181f0dad552 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Mon, 12 May 2014 02:01:10 +0200 Subject: [PATCH] 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 --- src/rgw/rgw_user.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; } -- 2.47.3