]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: eliminate _dispatch_deploy function
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 28 Sep 2023 18:15:55 +0000 (14:15 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 10 Oct 2023 14:33:48 +0000 (10:33 -0400)
Eliminate the _dispatch_deploy function, folding it into the
_common_deploy function, because the mass of if-elif lines have
been replaced and keeping it as a separate function no longer
serves much of a useful purpose.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index f312ca663436595243c308f1967c6bfdade5eeae..f9041317f4db247f3e47620664c79bab99c4ec8a 100755 (executable)
@@ -5236,18 +5236,8 @@ def _common_deploy(ctx: CephadmContext) -> None:
 
     # Get and check ports explicitly required to be opened
     endpoints = fetch_endpoints(ctx)
-    _dispatch_deploy(ctx, ident, endpoints, deployment_type)
 
-
-def _dispatch_deploy(
-    ctx: CephadmContext,
-    ident: 'DaemonIdentity',
-    daemon_endpoints: List[EndPoint],
-    deployment_type: DeploymentType,
-) -> None:
-    daemon_type = ident.daemon_type
-
-    if daemon_type == CephadmAgent.daemon_type:
+    if ident.daemon_type == CephadmAgent.daemon_type:
         # get current user gid and uid
         uid = os.getuid()
         gid = os.getgid()
@@ -5258,17 +5248,15 @@ def _dispatch_deploy(
             uid,
             gid,
             deployment_type=deployment_type,
-            endpoints=daemon_endpoints,
+            endpoints=endpoints,
         )
 
     else:
         try:
-            _deploy_daemon_container(
-                ctx, ident, daemon_endpoints, deployment_type
-            )
+            _deploy_daemon_container(ctx, ident, endpoints, deployment_type)
         except UnexpectedDaemonTypeError:
             raise Error('daemon type {} not implemented in command_deploy function'
-                        .format(daemon_type))
+                        .format(ident.daemon_type))
 
 
 def _deploy_daemon_container(