]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: adapt env_var handling
authorJoshua Schmid <jschmid@suse.de>
Tue, 12 May 2020 10:07:45 +0000 (12:07 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 21 May 2020 21:33:18 +0000 (23:33 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
(cherry picked from commit 6d7a65f2936c6e92330aeb466b28638c33a80e13)

src/pybind/mgr/cephadm/module.py

index 7d6554175c1f3909e3c1a2ba702f64844173af5d..ac63bb8ed4ff3d920378e0fd62587887e7a7c1d3 100644 (file)
@@ -851,10 +851,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
                      stdin=None,
                      no_fsid=False,
                      error_ok=False,
-                     image=None):
-        # type: (str, Optional[str], str, List[str], Optional[str], Optional[str], bool, bool, Optional[str]) -> Tuple[List[str], List[str], int]
+                     image=None,
+                     env_vars=None):
+        # type: (str, Optional[str], str, List[str], Optional[str], Optional[str], bool, bool, Optional[str], Optional[List[str]]) -> Tuple[List[str], List[str], int]
         """
         Run cephadm on the remote host with the given command + args
+
+        :env_vars: in format -> [KEY=VALUE, ..]
         """
         if not addr and host in self.inventory:
             addr = self.inventory.get_addr(host)
@@ -886,6 +889,11 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
             self.log.debug('%s container image %s' % (entity, image))
 
             final_args = []
+
+            if env_vars:
+                for env_var_pair in env_vars:
+                    final_args.extend(['--env', env_var_pair])
+
             if image:
                 final_args.extend(['--image', image])
             final_args.append(command)