]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_rest_user.cc: reduce scope of key_type
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 23 Oct 2014 17:55:55 +0000 (19:55 +0200)
committerSage Weil <sage@redhat.com>
Mon, 27 Oct 2014 19:44:25 +0000 (12:44 -0700)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_rest_user.cc

index 6e88443d393a193e5c1b4f1c8e907e51bc7ddd2d..105c2924fdc5361f7360cab8ba482e009c3f3c85 100644 (file)
@@ -520,8 +520,6 @@ void RGWOp_Key_Remove::execute()
   std::string access_key;
   std::string key_type_str;
 
-  int32_t key_type = KEY_TYPE_UNDEFINED;
-
   RGWUserAdminOpState op_state;
 
   RESTArgs::get_string(s, "uid", uid, &uid);
@@ -540,6 +538,7 @@ void RGWOp_Key_Remove::execute()
     op_state.set_access_key(access_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)