From: Michael Fritch Date: Thu, 28 Jan 2021 19:17:22 +0000 (-0700) Subject: mgr/cephadm: Do not assign a lambda expression, use a def (E731) X-Git-Tag: v16.2.0~178^2~37 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85d6e625dd6ba0ca486aea1f876ad3afa17559bc;p=ceph.git mgr/cephadm: Do not assign a lambda expression, use a def (E731) Signed-off-by: Michael Fritch (cherry picked from commit e26db8c21063f53d2fe471d39e6cf4037e3ead15) --- diff --git a/src/pybind/mgr/cephadm/tests/test_scheduling.py b/src/pybind/mgr/cephadm/tests/test_scheduling.py index 1d41fcc9710..071c5c26e72 100644 --- a/src/pybind/mgr/cephadm/tests/test_scheduling.py +++ b/src/pybind/mgr/cephadm/tests/test_scheduling.py @@ -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, )) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index b3543cc429a..b9590608891 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -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 diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini index f50f59399da..3666dd6e0a6 100644 --- a/src/pybind/mgr/tox.ini +++ b/src/pybind/mgr/tox.ini @@ -12,7 +12,6 @@ requires = cython max-line-length = 100 ignore = E501, - E731, E741, F401, F541,