]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: refactor `get_auth_entity()`
authorMichael Fritch <mfritch@suse.com>
Tue, 1 Sep 2020 19:32:44 +0000 (13:32 -0600)
committerNathan Cutler <ncutler@suse.com>
Tue, 6 Oct 2020 09:40:53 +0000 (11:40 +0200)
- convert to f-strings
- mgr keyring format is same as osd, mds
- crash client keyring is same as nfs, iscsi, etc

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 9d2031f01de4542f9a03f1234d5794395ae9162b)

src/pybind/mgr/cephadm/services/cephadmservice.py

index f43c61f88bd7c4e3a5c8005eb272aa9265de4783..476dde93751ff284e3cc4b361c9f9a42feb9c1cc 100644 (file)
@@ -234,17 +234,15 @@ class CephadmService(metaclass=ABCMeta):
         Map the daemon id to a cephx keyring entity name
         """
         if self.TYPE in ['rgw', 'rbd-mirror', 'nfs', "iscsi"]:
-            return AuthEntity('client.' + self.TYPE + "." + daemon_id)
+            return AuthEntity(f'client.{self.TYPE}.{daemon_id}')
         elif self.TYPE == 'crash':
             if host == "":
                 raise OrchestratorError("Host not provided to generate <crash> auth entity name")
-            return AuthEntity('client.' + self.TYPE + "." + host)
+            return AuthEntity(f'client.{self.TYPE}.{host}')
         elif self.TYPE == 'mon':
             return AuthEntity('mon.')
-        elif self.TYPE == 'mgr':
-            return AuthEntity(self.TYPE + "." + daemon_id)
-        elif self.TYPE in ['osd', 'mds', 'client']:
-            return AuthEntity(self.TYPE + "." + daemon_id)
+        elif self.TYPE in ['mgr', 'osd', 'mds']:
+            return AuthEntity(f'{self.TYPE}.{daemon_id}')
         else:
             raise OrchestratorError("unknown daemon type")