From af2058536b49309d7408d6cb19d04dc292218419 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 28 Sep 2023 14:15:55 -0400 Subject: [PATCH] cephadm: eliminate _dispatch_deploy function 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 --- src/cephadm/cephadm.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index f312ca66343..f9041317f4d 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -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( -- 2.39.5