INNER CODE UNIT · Python
_run_exec
Minituff/nautical-backup · app/backup.py:327
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", ""))
command = str(self.get_label(c, "exec.before", curl_command))
if curl_command and curl_command != "":
self.log_this(
f"Deprecated: '{self.prefix}.curl.before' has been moved to '{self.prefix}.exec.before'",
"WARN",