]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/MonCommand: populate 'availability' field for compat
authorSage Weil <sage@redhat.com>
Mon, 10 Dec 2018 12:54:15 +0000 (06:54 -0600)
committerSage Weil <sage@redhat.com>
Mon, 10 Dec 2018 12:54:15 +0000 (06:54 -0600)
The CLI will behave if this field is not included in teh JSON, but when you have
a nautilus+ leader mon and a luminous or mimic peon mon they will decode this empty
field and include "avail": "" in the JSON command descriptions, which the CLI does
not like.

Fix by encoding "cli,rest" in this field for the benefit of old mons.

Fixes: http://tracker.ceph.com/issues/37583
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonCommand.h

index a66d04861506e73941fa96b649e55cc175589917..97c49127cca137ea303dd16b38c3d2840c6439a2 100644 (file)
@@ -59,7 +59,7 @@ struct MonCommand {
     encode(helpstring, bl);
     encode(module, bl);
     encode(req_perms, bl);
-    std::string availability;  // Removed field, for backward compat
+    std::string availability = "cli,rest";  // Removed field, for backward compat
     encode(availability, bl);
   }
   void decode_bare(bufferlist::const_iterator &bl) {