From: John Mulligan Date: Wed, 24 May 2023 18:11:52 +0000 (-0400) Subject: mgr/cephadm: allow passing a list as a compound command to _run_cephadm X-Git-Tag: v18.2.1~326^2~62 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6f12ddbb40d9ef5d57407390302af4d566a619d9;p=ceph-ci.git mgr/cephadm: allow passing a list as a compound command to _run_cephadm As we're adding "namespaces" to the cephadm command it's easier to work with a compound list of terms as the command. This also avoids an issue where the function call injects args between the command and the "args" passed to _run_cephadm. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index 9460d68e823..58c7490d5af 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -1431,7 +1431,7 @@ class CephadmServe: async def _run_cephadm(self, host: str, entity: Union[CephadmNoImage, str], - command: str, + command: Union[str, List[str]], args: List[str], addr: Optional[str] = "", stdin: Optional[str] = "", @@ -1496,7 +1496,10 @@ class CephadmServe: final_args += ['--timeout', str(timeout)] # subcommand - final_args.append(command) + if isinstance(command, list): + final_args.extend([str(v) for v in command]) + else: + final_args.append(command) # subcommand args if not no_fsid: