]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/tests: fix style 51243/head
authorSage Weil <sage@newdream.net>
Thu, 20 Jan 2022 18:15:06 +0000 (13:15 -0500)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Fri, 17 Nov 2023 20:30:18 +0000 (03:30 +0700)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 8c7808d15d4daa4e9d1e984a6d73f7e6a1ff5642)

src/pybind/mgr/tests/__init__.py
src/pybind/mgr/tests/test_tls.py

index 22d97e3267e6321159aaf8ff2cb741480e444a42..97606ed3e8df53a41cd150018b51fbbd5b6c25ec 100644 (file)
@@ -63,7 +63,7 @@ if 'UNITTEST' in os.environ:
         def _ceph_get_store_prefix(self, prefix):
             return self.mock_store_prefix('store', prefix)
 
-        def _ceph_get_module_option(self, module, key, localized_prefix= None):
+        def _ceph_get_module_option(self, module, key, localized_prefix=None):
             try:
                 _, val, _ = self.check_mon_command({
                     'prefix': 'config get',
@@ -109,7 +109,7 @@ if 'UNITTEST' in os.environ:
             # Mocking the config store is handy sometimes:
             def config_get():
                 who = cmd['who'].split('.')
-                whos = ['global'] + ['.'.join(who[:i+1]) for i in range(len(who))]
+                whos = ['global'] + ['.'.join(who[:i + 1]) for i in range(len(who))]
                 for attepmt in reversed(whos):
                     val = self.mock_store_get('config', f'{attepmt}/{cmd["key"]}', None)
                     if val is not None:
@@ -152,7 +152,7 @@ if 'UNITTEST' in os.environ:
 
         def _ceph_get_foreign_option(self, entity, name):
             who = entity.split('.')
-            whos = ['global'] + ['.'.join(who[:i+1]) for i in range(len(who))]
+            whos = ['global'] + ['.'.join(who[:i + 1]) for i in range(len(who))]
             for attepmt in reversed(whos):
                 val = self.mock_store_get('config', f'{attepmt}/{name}', None)
                 if val is not None:
@@ -175,7 +175,6 @@ if 'UNITTEST' in os.environ:
             if not hasattr(self, '_store'):
                 self._store = {}
 
-
             if self.__class__ not in M_classes:
                 # call those only once.
                 self._register_commands('')
@@ -195,7 +194,6 @@ if 'UNITTEST' in os.environ:
             self._ceph_dispatch_remote = lambda *_: None
             self._ceph_get_mgr_id = mock.MagicMock()
 
-
     cm = mock.Mock()
     cm.BaseMgrModule = M
     cm.BaseMgrStandbyModule = M
index 923d91917caf27c5d18871073b77811cc828ba98..fda463cd2f4d8f376b5bd5895cff6bdb952a6f1d 100644 (file)
@@ -15,7 +15,8 @@ class TLSchecks(unittest.TestCase):
         verify_tls(crt, key)
 
     def test_invalid_RDN(self):
-        self.assertRaises(ValueError, create_self_signed_cert, dname={'O': 'Ceph', 'Bogus': 'testsuite'})
+        self.assertRaises(ValueError, create_self_signed_cert,
+                          dname={'O': 'Ceph', 'Bogus': 'testsuite'})
 
     def test_invalid_key(self):
         crt, key = create_self_signed_cert()