summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-10-14 10:26:49 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-10-14 10:26:49 -0700
commit4b8eb4ffdd3b4a51ee9453bcce6eea6de1c81515 (patch)
treee46ff07ba063b226db635c8c14f17b6e7c527b7e
parent0f73f0acaf87b73c932d4b2bad1f981503554f63 (diff)
downloadceph-4b8eb4ffdd3b4a51ee9453bcce6eea6de1c81515.tar.gz
radosgw-admin: add --quota-scope param to usage
and also look at it when setting quota on a bucket. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_admin.cc5
-rw-r--r--src/test/cli/radosgw-admin/help.t1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc
index 11d8c71ad15..b23bf3ba5d4 100644
--- a/src/rgw/rgw_admin.cc
+++ b/src/rgw/rgw_admin.cc
@@ -161,6 +161,7 @@ void _usage()
cerr << " --bucket specified bucket for quota command\n";
cerr << " --max-objects specify max objects\n";
cerr << " --max-size specify max size (in bytes)\n";
+ cerr << " --quota-scope scope of quota (bucket, user)\n";
cerr << "\n";
generic_client_usage();
}
@@ -2324,6 +2325,10 @@ next:
}
if (!bucket_name.empty()) {
+ if (!quota_scope.empty() && quota_scope != "bucket") {
+ cerr << "ERROR: invalid quota scope specification." << std::endl;
+ return EINVAL;
+ }
set_bucket_quota(store, opt_cmd, bucket_name, max_size, max_objects);
} else if (!user_id.empty()) {
if (quota_scope != "bucket") {
diff --git a/src/test/cli/radosgw-admin/help.t b/src/test/cli/radosgw-admin/help.t
index ed559916b4c..417c04ee777 100644
--- a/src/test/cli/radosgw-admin/help.t
+++ b/src/test/cli/radosgw-admin/help.t
@@ -123,6 +123,7 @@
--bucket specified bucket for quota command
--max-objects specify max objects
--max-size specify max size (in bytes)
+ --quota-scope scope of quota (bucket, user)
--conf/-c Read configuration from the given configuration file
--id/-i set ID portion of my name