From: Michael Fritch Date: Thu, 28 Jan 2021 19:23:48 +0000 (-0700) Subject: mgr/cephadm: Missing whitespace around arithmetic operator (E226) X-Git-Tag: v17.1.0~3027^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef45cc50b583797b13c29f656dd65f21763297b6;p=ceph.git mgr/cephadm: Missing whitespace around arithmetic operator (E226) Signed-off-by: Michael Fritch --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 9e0232f433f..ebc0b4dc16d 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1533,7 +1533,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, sm[n].container_image_name = 'mix' if dd.daemon_type == 'haproxy' or dd.daemon_type == 'keepalived': # ha-rgw has 2 daemons running per host - sm[n].size = sm[n].size*2 + sm[n].size = sm[n].size * 2 for n, spec in self.spec_store.specs.items(): if n in sm: continue @@ -1552,7 +1552,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, sm[n].rados_config_location = spec.rados_config_location() if spec.service_type == 'ha-rgw': # ha-rgw has 2 daemons running per host - sm[n].size = sm[n].size*2 + sm[n].size = sm[n].size * 2 return list(sm.values()) @trivial_completion diff --git a/src/pybind/mgr/cephadm/schedule.py b/src/pybind/mgr/cephadm/schedule.py index ca459c4069b..8ad2bae4fa1 100644 --- a/src/pybind/mgr/cephadm/schedule.py +++ b/src/pybind/mgr/cephadm/schedule.py @@ -124,9 +124,10 @@ class HostAssignment(object): logger.debug('Provided hosts: %s' % candidates) # if asked to place even number of mons, deploy 1 less if self.spec.service_type == 'mon' and (len(candidates) % 2) == 0: + count = len(candidates) - 1 logger.info("Deploying %s monitor(s) instead of %s so monitors may achieve consensus" % ( - len(candidates) - 1, len(candidates))) - return candidates[0:len(candidates)-1] + count, len(candidates))) + return candidates[0:count] # do not deploy ha-rgw on hosts that don't support virtual ips if self.spec.service_type == 'ha-rgw' and self.filter_new_host: diff --git a/src/pybind/mgr/cephadm/tests/test_completion.py b/src/pybind/mgr/cephadm/tests/test_completion.py index b43cd6a860d..80592ba779d 100644 --- a/src/pybind/mgr/cephadm/tests/test_completion.py +++ b/src/pybind/mgr/cephadm/tests/test_completion.py @@ -20,7 +20,7 @@ class TestCompletion(object): def test_trivial(self, cephadm_module): @trivial_completion def run(x): - return x+1 + return x + 1 assert wait(cephadm_module, run(1)) == 2 def test_exception(self, cephadm_module): diff --git a/src/pybind/mgr/orchestrator/tests/test_orchestrator.py b/src/pybind/mgr/orchestrator/tests/test_orchestrator.py index 0f456d7c711..4f215f8e7ac 100644 --- a/src/pybind/mgr/orchestrator/tests/test_orchestrator.py +++ b/src/pybind/mgr/orchestrator/tests/test_orchestrator.py @@ -205,7 +205,7 @@ def test_pretty_print(): mgr.process = lambda cs: [c.finalize(None) for c in cs] def add_one(x): - return x+1 + return x + 1 c = Completion(value=1, on_complete=add_one).then( str diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini index 149be44ce6c..3c4d0aa0b32 100644 --- a/src/pybind/mgr/tox.ini +++ b/src/pybind/mgr/tox.ini @@ -11,7 +11,6 @@ requires = cython [flake8] max-line-length = 100 ignore = - E226, E231, E241, E261,