summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-08-02 15:06:16 -0700
committerSage Weil <sage@inktank.com>2013-08-02 15:19:13 -0700
commitafb1fc344b90e7bbdb8694ca5246ca957025877e (patch)
treed5532c15896a284a3b198fea133b5dd09c8a5a2b
parentca35e15278a0e4ad34861b98d222a9778154a045 (diff)
downloadceph-afb1fc344b90e7bbdb8694ca5246ca957025877e.tar.gz
mon: translate caps lists to key/value map
Take original changes from ca8ac9502bdfce888decd4b53669ef57858afcf6 and apply them to this new all-powerful _allowed_command() helper. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/mon/Monitor.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index 6d91f52d4b2..20a799f3e52 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -1901,6 +1901,17 @@ bool Monitor::_allowed_command(MonSession *s, string &module, string &prefix,
p != cmdmap.end(); ++p) {
if (p->first == "prefix")
continue;
+ if (p->first == "caps") {
+ vector<string> cv;
+ if (cmd_getval(g_ceph_context, cmdmap, "caps", cv) &&
+ cv.size() % 2 == 0) {
+ for (unsigned i = 0; i < cv.size(); i += 2) {
+ string k = string("caps_") + cv[i];
+ strmap[k] = cv[i + 1];
+ }
+ continue;
+ }
+ }
strmap[p->first] = cmd_vartype_stringify(p->second);
}