summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-10-10 21:04:39 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-10-10 21:04:39 -0700
commit1803f3b0e16bf0907791cf11c1bd090eca783a4d (patch)
tree11c2dab17faf99850bc3fcf38340e9b083e7b501
parent89d3f47f621823823b50217527641ed92bdb5d14 (diff)
downloadceph-1803f3b0e16bf0907791cf11c1bd090eca783a4d.tar.gz
radosgw-admin: limit user bucket-level quota
We only allow it if --quota-scope=bucket is specified. This is done in order to avoid confusion with the future user level quota command. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_admin.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc
index 5058d11de74..70cf7b85bbb 100644
--- a/src/rgw/rgw_admin.cc
+++ b/src/rgw/rgw_admin.cc
@@ -797,6 +797,7 @@ int main(int argc, char **argv)
string replica_log_type_str;
ReplicaLogType replica_log_type = ReplicaLog_Invalid;
string op_mask_str;
+ string quota_scope;
int64_t max_objects = -1;
int64_t max_size = -1;
@@ -931,6 +932,8 @@ int main(int argc, char **argv)
start_marker = val;
} else if (ceph_argparse_witharg(args, i, &val, "--end-marker", (char*)NULL)) {
end_marker = val;
+ } else if (ceph_argparse_witharg(args, i, &val, "--quota-scope", (char*)NULL)) {
+ quota_scope = val;
} else if (ceph_argparse_witharg(args, i, &val, "--replica-log-type", (char*)NULL)) {
replica_log_type_str = val;
replica_log_type = get_replicalog_type(replica_log_type_str);
@@ -2323,6 +2326,10 @@ next:
if (!bucket_name.empty()) {
set_bucket_quota(store, opt_cmd, bucket_name, max_size, max_objects);
} else if (!user_id.empty()) {
+ if (quota_scope != "bucket") {
+ cerr << "ERROR: only bucket-level user quota can be handled. Please specify --quota-scope=bucket" << std::endl;
+ return EINVAL;
+ }
set_user_bucket_quota(opt_cmd, user, user_op, max_size, max_objects);
}
}