]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_admin: can lookup user by access key
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 18 Apr 2011 15:15:11 +0000 (08:15 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 18 Apr 2011 15:15:11 +0000 (08:15 -0700)
src/rgw/rgw_admin.cc

index 5c4ea443305b2d15685d2068ff3482c22b083b79..c87a0f8cbec95e00e178e22719308af6223093f5 100644 (file)
@@ -35,7 +35,7 @@ void usage()
   cerr << "  log show                   dump a log from specific bucket, date\n";
   cerr << "options:\n";
   cerr << "   --uid=<id>                user id\n";
-  cerr << "   --s3-key=<id>             S3 access key\n";
+  cerr << "   --access-key=<id>         S3 access key\n";
   cerr << "   --os-user=<group:name>    OpenStack user\n";
   cerr << "   --email=<email>\n";
   cerr << "   --auth_uid=<auid>         librados uid\n";
@@ -258,6 +258,14 @@ int main(int argc, char **argv)
        cerr << "could not find user by specified email" << std::endl;
       }
     }
+    if (!found && access_key) {
+      s = access_key;
+      if (rgw_get_uid_by_access_key(s, user_id_str, info) >= 0) {
+       found = true;
+      } else {
+       cerr << "could not find user by specified access key" << std::endl;
+      }
+    }
     if (!found && openstack_user) {
       s = openstack_user;
       if (rgw_get_uid_by_openstack(s, user_id_str, info) >= 0) {