From: Yehuda Sadeh Date: Mon, 18 Apr 2011 15:15:11 +0000 (-0700) Subject: rgw_admin: can lookup user by access key X-Git-Tag: v0.27~21^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11f1e2ef52abdb6dee4a890081e3e1ae93d433b6;p=ceph.git rgw_admin: can lookup user by access key --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 5c4ea443305b2..c87a0f8cbec95 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -35,7 +35,7 @@ void usage() cerr << " log show dump a log from specific bucket, date\n"; cerr << "options:\n"; cerr << " --uid= user id\n"; - cerr << " --s3-key= S3 access key\n"; + cerr << " --access-key= S3 access key\n"; cerr << " --os-user= OpenStack user\n"; cerr << " --email=\n"; cerr << " --auth_uid= 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) {