]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph.in: allow 'flags' to not be present in cmddescs
authorDan Mick <dan.mick@redhat.com>
Fri, 16 Dec 2016 22:58:46 +0000 (14:58 -0800)
committerDan Mick <dan.mick@redhat.com>
Fri, 16 Dec 2016 22:59:17 +0000 (14:59 -0800)
the 'flags' key in the command description dict may not be
present on older monitors.  Check for existence before
using it.

Introduced in 61d63433dfdcc08ecc21ba4f645794da5e01823c

Fixes: http://tracker.ceph.com/issues/18297
Signed-off-by: Dan Mick <dan.mick@redhat.com>
src/ceph.in

index a32d42c8e9ce07cfd7fdfa6a31f06e15b1d343a6..c2da5c509d0bdbc638dbbf96335620d4737670b5 100755 (executable)
@@ -342,7 +342,9 @@ def format_help(cmddict, partial=None):
 
         if not cmd['help']:
             continue
-        if cmd['flags'] is not None and ((cmd['flags'] & (FLAG_OBSOLETE | FLAG_DEPRECATED)) != 0):
+        flags = cmd.get('flags')
+        if (flags is not None and
+            (flags & (FLAG_OBSOLETE | FLAG_DEPRECATED)) != 0):
             continue
         concise = concise_sig(cmd['sig'])
         if partial and not concise.startswith(partial):