Merge pull request #20846 from theanalyst/rgw/fix-empty-stats

rgw: radosgw-admin abort early for user stats for empty uids

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
This commit is contained in:
Casey Bodley 2018-03-23 09:52:38 -04:00 committed by GitHub
commit f97159c31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6149,6 +6149,11 @@ next:
}
if (opt_cmd == OPT_USER_STATS) {
if (user_id.empty()) {
cerr << "ERROR: uid not specified" << std::endl;
return EINVAL;
}
if (sync_stats) {
if (!bucket_name.empty()) {
int ret = rgw_bucket_sync_user_stats(store, tenant, bucket_name);
@ -6165,10 +6170,6 @@ next:
}
}
if (user_id.empty()) {
cerr << "ERROR: uid not specified" << std::endl;
return EINVAL;
}
cls_user_header header;
string user_str = user_id.to_str();
int ret = store->cls_user_get_header(user_str, &header);