]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: misc. autopep8 changes
authorAdam King <adking@redhat.com>
Wed, 5 May 2021 17:47:39 +0000 (13:47 -0400)
committerAdam King <adking@redhat.com>
Wed, 5 May 2021 17:50:22 +0000 (13:50 -0400)
Some of the file in mgr/cephadm are getting changed
every time I want to run the mgr tox tests to check
changes and it's inconvenient to have to check the
files out every time

Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/schedule.py
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/tests/test_cephadm.py

index d2c6e895a31d1cc44a1c4562cdca226bce3e86ac..81089a26437a94dddaa3a2c085973693d00b426a 100644 (file)
@@ -232,6 +232,7 @@ class ClientKeyringSpec(object):
     """
     A client keyring file that we should maintain
     """
+
     def __init__(
             self,
             entity: str,
index dbe723875049e74a848ecafcac37985a83c15229..92ff8f999da3f9744ee5c7c82dba9c282e488264 100644 (file)
@@ -27,7 +27,8 @@ class DaemonPlacement(NamedTuple):
         if self.name:
             other.append(f'name={self.name}')
         if self.ports:
-            other.append(f'{self.ip or "*"}:{self.ports[0] if len(self.ports) == 1 else ",".join(map(str, self.ports))}')
+            other.append(
+                f'{self.ip or "*"}:{self.ports[0] if len(self.ports) == 1 else ",".join(map(str, self.ports))}')
         if other:
             res += '(' + ' '.join(other) + ')'
         return res
index e92da1f9fbe217b3f56e4c0454c98c5da3497ec2..7de8e3a95df2b72ead8ff7fae56972b93ba31cb5 100644 (file)
@@ -157,7 +157,8 @@ class CephadmServe:
                         0o644, 0, 0, bytes(config), str(config_digest)
                     )
             except Exception as e:
-                self.mgr.log.warning(f'unable to calc conf hosts: {self.mgr.manage_etc_ceph_ceph_conf_hosts}: {e}')
+                self.mgr.log.warning(
+                    f'unable to calc conf hosts: {self.mgr.manage_etc_ceph_ceph_conf_hosts}: {e}')
 
         # client keyrings
         for ks in self.mgr.keys.keys.values():
@@ -171,7 +172,8 @@ class CephadmServe:
                 if ret:
                     self.log.warning(f'unable to fetch keyring for {ks.entity}')
                     continue
-                digest = ''.join('%02x' % c for c in hashlib.sha256(keyring.encode('utf-8')).digest())
+                digest = ''.join('%02x' % c for c in hashlib.sha256(
+                    keyring.encode('utf-8')).digest())
                 ha = HostAssignment(
                     spec=ServiceSpec('mon', placement=ks.placement),
                     hosts=self.mgr._schedulable_hosts(),
@@ -189,7 +191,8 @@ class CephadmServe:
                         ks.mode, ks.uid, ks.gid, keyring.encode('utf-8'), digest
                     )
             except Exception as e:
-                self.log.warning(f'unable to calc client keyring {ks.entity} placement {ks.placement}: {e}')
+                self.log.warning(
+                    f'unable to calc client keyring {ks.entity} placement {ks.placement}: {e}')
 
         @forall_hosts
         def refresh(host: str) -> None:
index e15fe409d2339a81c55bda8156947538725a9497..83df09ff4c7733f468d1468c5141b5fbdd486ab0 100644 (file)
@@ -1093,10 +1093,12 @@ class TestCephadm(object):
             assert '/etc/ceph/ceph.conf' in cephadm_module.cache.get_host_client_files('test')
 
             # Make sure, _check_daemons does a redeploy due to monmap change:
-            before_digest = cephadm_module.cache.get_host_client_files('test')['/etc/ceph/ceph.conf'][0]
+            before_digest = cephadm_module.cache.get_host_client_files('test')[
+                '/etc/ceph/ceph.conf'][0]
             cephadm_module._set_extra_ceph_conf('[mon]\nk2=v2')
             CephadmServe(cephadm_module)._refresh_hosts_and_daemons()
-            after_digest = cephadm_module.cache.get_host_client_files('test')['/etc/ceph/ceph.conf'][0]
+            after_digest = cephadm_module.cache.get_host_client_files('test')[
+                '/etc/ceph/ceph.conf'][0]
             assert before_digest != after_digest
 
     def test_etc_ceph_init(self):