]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MgrMonitor: use static mgr commands if none defined yet
authorSage Weil <sage@redhat.com>
Fri, 4 Aug 2017 18:37:41 +0000 (14:37 -0400)
committerSage Weil <sage@redhat.com>
Sun, 6 Aug 2017 13:56:55 +0000 (09:56 -0400)
During upgrade, we may get a command (like 'pg dump') before we
pass our first post-upgrade paxos round embedding the static mgr
commands.  Until then, use the static mgr commands (that's what
we're proposing anyway).

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

index fb760260f3ec695cb5e799c62cb8ad13c75c2714..fc4f08d8d70c51ec41bf23a1943f0e79d876410f 100644 (file)
@@ -938,3 +938,12 @@ int MgrMonitor::dump_metadata(const string& name, Formatter *f, ostream *err)
   return 0;
 }
 
+const std::vector<MonCommand> &MgrMonitor::get_command_descs() const
+{
+  if (command_descs.empty()) {
+    // must have just upgraded; fallback to static commands
+    return mgr_commands;
+  } else {
+    return command_descs;
+  }
+}
index f63fb714f795d6be8bb5d01eb207593225a09860..65451633dbefc0aa85c71bd4d65b50e222548922 100644 (file)
@@ -99,9 +99,7 @@ public:
 
   void print_summary(Formatter *f, std::ostream *ss) const;
 
-  const std::vector<MonCommand> &get_command_descs() const {
-    return command_descs;
-  }
+  const std::vector<MonCommand> &get_command_descs() const;
 
   int load_metadata(const string& name, std::map<string, string>& m,
                    ostream *err);