]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: squelch 'id' arg errors 20042/head
authorSage Weil <sage@redhat.com>
Wed, 17 Jan 2018 17:23:39 +0000 (11:23 -0600)
committerKefu Chai <kchai@redhat.com>
Mon, 22 Jan 2018 02:59:06 +0000 (10:59 +0800)
Several commands use 'id' but for other types (e.g., vector<int64_t>).

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 0580f0125bc014e5d97b8317a1bd53a3495f03bf)

Conflicts:
src/mon/OSDMonitor.cc: pass g_ceph_context instead of cct to
cmd_getval() to be consistent with other callsites of this function. we
can do the s/g_ceph_context/cct/ in another commit, if it turns out to
be a critical fix.

src/mon/OSDMonitor.cc

index 9dd03351bfb6b0060aea8156a4680be1c2dbe4c5..180b6967e65fa3e314839ca12d36886c2515d6c6 100644 (file)
@@ -7584,7 +7584,12 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
 
   int64_t osdid;
   string name;
-  bool osdid_present = cmd_getval(g_ceph_context, cmdmap, "id", osdid);
+  bool osdid_present = false;
+  if (prefix != "osd pg-temp" &&
+      prefix != "osd pg-upmap" &&
+      prefix != "osd pg-upmap-items") {  // avoid commands with non-int id arg
+    osdid_present = cmd_getval(g_ceph_context, cmdmap, "id", osdid);
+  }
   if (osdid_present) {
     ostringstream oss;
     oss << "osd." << osdid;