]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Do not assign a lambda expression, use a def (E731)
authorMichael Fritch <mfritch@suse.com>
Thu, 28 Jan 2021 19:17:22 +0000 (12:17 -0700)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 23 Feb 2021 09:58:23 +0000 (10:58 +0100)
Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit e26db8c21063f53d2fe471d39e6cf4037e3ead15)

src/pybind/mgr/cephadm/tests/test_scheduling.py
src/pybind/mgr/orchestrator/_interface.py
src/pybind/mgr/tox.ini

index 1d41fcc9710ad20e270f8582c0a566914ae448f1..071c5c26e72173219cfbf8905bb1a13fc00f34a0 100644 (file)
@@ -89,12 +89,12 @@ def get_result(key, results):
 def mk_spec_and_host(spec_section, hosts, explicit_key, explicit, count):
 
     if spec_section == 'hosts':
-        mk_spec = lambda: ServiceSpec('mgr', placement=PlacementSpec(
+        mk_spec = lambda: ServiceSpec('mgr', placement=PlacementSpec(  # noqa: E731
             hosts=explicit,
             count=count,
         ))
     elif spec_section == 'label':
-        mk_spec = lambda: ServiceSpec('mgr', placement=PlacementSpec(
+        mk_spec = lambda: ServiceSpec('mgr', placement=PlacementSpec(  # noqa: E731
             label='mylabel',
             count=count,
         ))
@@ -105,7 +105,7 @@ def mk_spec_and_host(spec_section, hosts, explicit_key, explicit, count):
             '12': '[1-2]',
             '123': '*',
         }[explicit_key]
-        mk_spec = lambda: ServiceSpec('mgr', placement=PlacementSpec(
+        mk_spec = lambda: ServiceSpec('mgr', placement=PlacementSpec(  # noqa: E731
             host_pattern=pattern,
             count=count,
         ))
index b3543cc429a7472eadb061757d6c596991fd8fcd..b959060889118eb940541b0cb6dbfe903ee2b2b9 100644 (file)
@@ -105,7 +105,7 @@ def handle_exception(prefix: str, perm: str, func: FuncT) -> FuncT:
             return HandleCommandResult(-errno.ENOENT, stderr=msg)
 
     # misuse lambda to copy `wrapper`
-    wrapper_copy = lambda *l_args, **l_kwargs: wrapper(*l_args, **l_kwargs)
+    wrapper_copy = lambda *l_args, **l_kwargs: wrapper(*l_args, **l_kwargs)  # noqa: E731
     wrapper_copy._prefix = prefix  # type: ignore
     wrapper_copy._cli_command = CLICommand(prefix, perm)  # type: ignore
     wrapper_copy._cli_command.store_func_metadata(func)  # type: ignore
index f50f59399da0a2c16442bfc48c1968896d1d73c3..3666dd6e0a67bae5f06bcdae0202138d97409e93 100644 (file)
@@ -12,7 +12,6 @@ requires = cython
 max-line-length = 100
 ignore =
     E501,
-    E731,
     E741,
     F401,
     F541,