From 11f1e2ef52abdb6dee4a890081e3e1ae93d433b6 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 18 Apr 2011 08:15:11 -0700 Subject: [PATCH] rgw_admin: can lookup user by access key --- src/rgw/rgw_admin.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) { -- 2.39.5