]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Missing whitespace around arithmetic operator (E226)
authorMichael Fritch <mfritch@suse.com>
Thu, 28 Jan 2021 19:23:48 +0000 (12:23 -0700)
committerMichael Fritch <mfritch@suse.com>
Fri, 5 Feb 2021 18:18:24 +0000 (11:18 -0700)
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/schedule.py
src/pybind/mgr/cephadm/tests/test_completion.py
src/pybind/mgr/orchestrator/tests/test_orchestrator.py
src/pybind/mgr/tox.ini

index 9e0232f433f6d804173f0a952490c052a3cadf12..ebc0b4dc16db083243ce90fba471c9ce02f9f64c 100644 (file)
@@ -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
index ca459c4069bbe65533a617357679977542c0c0b5..8ad2bae4fa1fc0d498d13bd49934d3a7122df25f 100644 (file)
@@ -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:
index b43cd6a860d07100135cf0c11ad67c73a4dcddc0..80592ba779dd893aa168008834f1117c389dc081 100644 (file)
@@ -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):
index 0f456d7c711fd284d58b22d4fe40923c2c5e1f85..4f215f8e7acc4920130b339db1a1e2c76aad038f 100644 (file)
@@ -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
index 149be44ce6c254766f130ebeea0b9b93c1f0fcbd..3c4d0aa0b32f91596a4fab5c32e1b6c223dc4780 100644 (file)
@@ -11,7 +11,6 @@ requires = cython
 [flake8]
 max-line-length = 100
 ignore =
-    E226,
     E231,
     E241,
     E261,