Skip to content

Commit

Permalink
Improve running command in chroot
Browse files Browse the repository at this point in the history
  • Loading branch information
pavinjosdev committed Apr 10, 2024
1 parent 6dd3c29 commit 0679d55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions atomic-update
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ from shlex import quote
import xml.etree.ElementTree as ET

# Constants
VERSION = "0.1.7"
VERSION = "0.1.8"
ZYPPER_PID_FILE = "/run/zypp.pid"
VALID_CMD = ["dup", "run", "rollback"]
VALID_OPT = ["--reboot", "--apply", "--shell", "--continue", "--no-verify", \
Expand Down Expand Up @@ -425,8 +425,8 @@ chroot {TMP_MOUNT_DIR} mount -a;
else:
logging.info(f"Distribution upgrade completed successfully")
elif COMMAND == "run":
exec_cmd = ' '.join(ARG)
logging.info(f"Running command {exec_cmd!r} within chroot...")
exec_cmd = " ".join( [quote(part) for part in ARG] )
logging.info(f"Running command >>> {exec_cmd} <<< within chroot...")
ret = os.system(f"chroot {TMP_MOUNT_DIR} {exec_cmd}")
if ret != 0:
logging.error(f"Command returned exit code {ret}")
Expand Down

0 comments on commit 0679d55

Please sign in to comment.