From: Danny Al-Gaaf Date: Wed, 22 Oct 2014 08:48:23 +0000 (+0200) Subject: rgw_rest_user.cc: reduce scope of key_type in several places X-Git-Tag: v0.88~22^2~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=10ddfbf0284d432cfc28cb5172b1a95b9f97543d;p=ceph.git rgw_rest_user.cc: reduce scope of key_type in several places Signed-off-by: Danny Al-Gaaf --- diff --git a/src/rgw/rgw_rest_user.cc b/src/rgw/rgw_rest_user.cc index c95ea4698643..6e88443d393a 100644 --- a/src/rgw/rgw_rest_user.cc +++ b/src/rgw/rgw_rest_user.cc @@ -68,7 +68,6 @@ void RGWOp_User_Create::execute() bool exclusive; uint32_t max_buckets; - int32_t key_type = KEY_TYPE_UNDEFINED; RGWUserAdminOpState op_state; @@ -111,6 +110,7 @@ void RGWOp_User_Create::execute() op_state.set_secret_key(secret_key); if (!key_type_str.empty()) { + int32_t key_type = KEY_TYPE_UNDEFINED; if (key_type_str.compare("swift") == 0) key_type = KEY_TYPE_SWIFT; else if (key_type_str.compare("s3") == 0) @@ -166,7 +166,6 @@ void RGWOp_User_Modify::execute() bool system; uint32_t max_buckets; - int32_t key_type = KEY_TYPE_UNDEFINED; RGWUserAdminOpState op_state; @@ -214,6 +213,7 @@ void RGWOp_User_Modify::execute() op_state.set_generate_key(); if (!key_type_str.empty()) { + int32_t key_type = KEY_TYPE_UNDEFINED; if (key_type_str.compare("swift") == 0) key_type = KEY_TYPE_SWIFT; else if (key_type_str.compare("s3") == 0) @@ -459,7 +459,6 @@ void RGWOp_Key_Create::execute() std::string secret_key; std::string key_type_str; - int32_t key_type = KEY_TYPE_UNDEFINED; bool gen_key; RGWUserAdminOpState op_state; @@ -488,6 +487,7 @@ void RGWOp_Key_Create::execute() op_state.set_generate_key(); if (!key_type_str.empty()) { + int32_t key_type = KEY_TYPE_UNDEFINED; if (key_type_str.compare("swift") == 0) key_type = KEY_TYPE_SWIFT; else if (key_type_str.compare("s3") == 0)