]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_rest_user.cc: reduce scope of key_type in several places
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 22 Oct 2014 08:48:23 +0000 (10:48 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 26 Oct 2014 17:10:13 +0000 (18:10 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_rest_user.cc

index c95ea46986439fc3a65cc57a4baa847f869ae628..6e88443d393a193e5c1b4f1c8e907e51bc7ddd2d 100644 (file)
@@ -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)