summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2018-08-12 20:34:50 +0200
committerSage Weil <sage@redhat.com>2018-08-31 22:54:58 +0200
commitc2457ffbac3eb46c8aa1d347a93030c8f54d64ad (patch)
tree18e36f3d375b3d310a41711f37d624cfbdaf086d /src
parentosd/OSDCap: remove auid from grammar (diff)
downloadceph-c2457ffbac3eb46c8aa1d347a93030c8f54d64ad.tar.xz
ceph-c2457ffbac3eb46c8aa1d347a93030c8f54d64ad.zip
mon/OSDMonitor: remove auid arg for 'osd lspools' and deprecate
Use 'osd pool ls' instead. Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/mon/MonCommands.h5
-rw-r--r--src/mon/OSDMonitor.cc22
-rwxr-xr-xsrc/test/pybind/test_ceph_argparse.py4
3 files changed, 12 insertions, 19 deletions
diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h
index 379c792906a..d20728e88cc 100644
--- a/src/mon/MonCommands.h
+++ b/src/mon/MonCommands.h
@@ -502,9 +502,8 @@ COMMAND("osd map " \
"name=object,type=CephObjectname " \
"name=nspace,type=CephString,req=false", \
"find pg for <object> in <pool> with [namespace]", "osd", "r", "cli,rest")
-COMMAND("osd lspools " \
- "name=auid,type=CephInt,req=false", \
- "list pools", "osd", "r", "cli,rest")
+COMMAND_WITH_FLAG("osd lspools", \
+ "list pools", "osd", "r", "cli,rest", FLAG(DEPRECATED))
COMMAND_WITH_FLAG("osd crush rule list", "list crush rules", "osd", "r", "cli,rest",
FLAG(DEPRECATED))
COMMAND("osd crush rule ls", "list crush rules", "osd", "r", "cli,rest")
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index ea333b62ec9..0c94433a0eb 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -4784,24 +4784,20 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
goto reply;
} else if (prefix == "osd lspools") {
- int64_t auid;
- cmd_getval_throws(cct, cmdmap, "auid", auid, int64_t(0));
if (f)
f->open_array_section("pools");
for (map<int64_t, pg_pool_t>::iterator p = osdmap.pools.begin();
p != osdmap.pools.end();
++p) {
- if (!auid || p->second.auid == (uint64_t)auid) {
- if (f) {
- f->open_object_section("pool");
- f->dump_int("poolnum", p->first);
- f->dump_string("poolname", osdmap.pool_name[p->first]);
- f->close_section();
- } else {
- ds << p->first << ' ' << osdmap.pool_name[p->first];
- if (next(p) != osdmap.pools.end()) {
- ds << '\n';
- }
+ if (f) {
+ f->open_object_section("pool");
+ f->dump_int("poolnum", p->first);
+ f->dump_string("poolname", osdmap.pool_name[p->first]);
+ f->close_section();
+ } else {
+ ds << p->first << ' ' << osdmap.pool_name[p->first];
+ if (next(p) != osdmap.pools.end()) {
+ ds << '\n';
}
}
}
diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py
index 55e04c231d7..3e73211090e 100755
--- a/src/test/pybind/test_ceph_argparse.py
+++ b/src/test/pybind/test_ceph_argparse.py
@@ -570,10 +570,8 @@ class TestOSD(TestArgparse):
def test_lspools(self):
self.assert_valid_command(['osd', 'lspools'])
- self.assert_valid_command(['osd', 'lspools', '1'])
- self.assert_valid_command(['osd', 'lspools', '-1'])
assert_equal({}, validate_command(sigdict, ['osd', 'lspools',
- '1', 'toomany']))
+ 'toomany']))
def test_blacklist_ls(self):
self.assert_valid_command(['osd', 'blacklist', 'ls'])