]> 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)
committerJoshua Schmid <jschmid@suse.de>
Tue, 12 May 2020 10:07:45 +0000 (12:07 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/pybind/mgr/cephadm/module.py

index 3e3c8d1a0b22ccc751c8622e477520525de335e6..d834e391c34303c21bcec237d4795edc08fdac38 100644 (file)
@@ -911,10 +911,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)
@@ -946,6 +949,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)