]> git.apps.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)
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 ef45cc50b583797b13c29f656dd65f21763297b6)

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 48cae0a4b53575a0754c22e174efb6f72cb04876..cebb09a5ed7c48178be0a695d7d2a5e036bad725 100644 (file)
@@ -1541,7 +1541,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
@@ -1560,7 +1560,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 436428401325b2486125d46ca254f9b0874dd496..3c04398f71da1f924e50ca6d48d95da8eae08f94 100644 (file)
@@ -11,7 +11,6 @@ requires = cython
 [flake8]
 max-line-length = 100
 ignore =
-    E226,
     E231,
     E241,
     E261,