INNER CODE UNIT · Python
_set_exec_environment_variables
Minituff/nautical-backup · app/backup.py:321
def _set_exec_environment_variables(self, vars: Dict[str, str]):
"""Set the environment variables for the exec command"""
for k, v in vars.items(): # Loop through all the variables in the class
self.log_this(f"Setting environment variable {k} to {v}", "TRACE")
os.environ[k] = v # Set the environment variable
def _run_exec(
self,
c: Optional[Container],
when: BeforeAfterorDuring,
attached_to_container=False,
) -> Optional[subprocess.CompletedProcess[bytes]]:
"""Runs a exec command from the Nautical Container itself."""
command = "" # Curl command
if attached_to_container == True and c:
if when == BeforeAfterorDuring.BEFORE:
curl_command = str(self.get_label(c, "curl.before", ""))