Skip to content

Commit 0679d55

Browse files
committed
Improve running command in chroot
1 parent 6dd3c29 commit 0679d55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

atomic-update

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ from shlex import quote
2828
import xml.etree.ElementTree as ET
2929

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

0 commit comments

Comments
 (0)