]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/mgr_module: use 'not in' for checking membership
authorKefu Chai <kchai@redhat.com>
Sun, 27 Dec 2020 08:42:15 +0000 (16:42 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 14 Jan 2021 14:08:35 +0000 (22:08 +0800)
silences the warning from flake8 like

test for membership should be 'not in' [E713]

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/mgr_module.py

index aa4699cacca1a7afea3945850f408370299fd14c..85124d6d7183dbed870c34ce4675f500efc10582 100644 (file)
@@ -425,7 +425,7 @@ def CLIWriteCommand(prefix, args=""):
 def CLICheckNonemptyFileInput(func):
     @functools.wraps(func)
     def check(*args, **kwargs):
-        if not 'inbuf' in kwargs:
+        if 'inbuf' not in kwargs:
             return -errno.EINVAL, '', ERROR_MSG_NO_INPUT_FILE
         if not kwargs['inbuf'] or (isinstance(kwargs['inbuf'], str)
                                    and not kwargs['inbuf'].strip('\n')):