]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/ConfigMonitor: make 'config get' on fsid work
authorSage Weil <sage@redhat.com>
Sun, 19 Jan 2020 21:21:13 +0000 (15:21 -0600)
committerSage Weil <sage@redhat.com>
Mon, 20 Jan 2020 19:12:04 +0000 (13:12 -0600)
This duplicates 'ceph fsid' command, but allow this for consistency.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/ConfigMonitor.cc

index 0890b22692abe9120ce1e5dd4bdc8dd35033fa2f..a599233be5d6296be8801357739e6d78829a100a 100644 (file)
@@ -295,6 +295,12 @@ bool ConfigMonitor::preprocess_command(MonOpRequestRef op)
        goto reply;
       }
       if (opt->has_flag(Option::FLAG_NO_MON_UPDATE)) {
+       // handle special options
+       if (name == "fsid") {
+         odata.append(stringify(mon->monmap->get_fsid()));
+         odata.append("\n");
+         goto reply;
+       }
        err = -EINVAL;
        ss << name << " is special and cannot be stored by the mon";
        goto reply;