From: Dan Mick Date: Fri, 16 Dec 2016 22:58:46 +0000 (-0800) Subject: ceph.in: allow 'flags' to not be present in cmddescs X-Git-Tag: v11.1.1~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12540%2Fhead;p=ceph.git ceph.in: allow 'flags' to not be present in cmddescs 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 --- diff --git a/src/ceph.in b/src/ceph.in index a32d42c8e9ce..c2da5c509d0b 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -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):