Skip to content

Commit 41e0e9b

Browse files
committed
Fix logging
1 parent a1f2b1e commit 41e0e9b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

atomic-update

Lines changed: 6 additions & 4 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.1"
31+
VERSION = "0.1.2"
3232
ZYPPER_PID_FILE = "/run/zypp.pid"
3333
VALID_CMD = ["dup", "run", "rollback"]
3434
VALID_OPT = ["--reboot", "--apply", "--shell", "--continue", "--no-verify", \
@@ -380,7 +380,7 @@ if COMMAND in ["dup", "run"]:
380380
rootfs_device = out["source"].split("[")[0]
381381
logging.debug(f"Btrfs root device: {rootfs_device}")
382382
# populate temp dir with atomic snapshot mounts
383-
logging.info("Setting up temp mounts...")
383+
logging.debug("Setting up temp mounts...")
384384
commands = f"""
385385
mount -o subvol={snap_subvol} {rootfs_device} {TMP_MOUNT_DIR};
386386
for i in dev proc run sys; do mount --rbind --make-rslave /$i {TMP_MOUNT_DIR}/$i; done;
@@ -411,7 +411,8 @@ chroot {TMP_MOUNT_DIR} mount -a;
411411
shell_exec(f"snapper -c {snapper_root_config} delete {atomic_snap}")
412412
cleanup()
413413
sys.exit(9)
414-
logging.info(f"Distribution upgrade completed successfully")
414+
else:
415+
logging.info(f"Distribution upgrade completed successfully")
415416
elif COMMAND == "run":
416417
exec_cmd = ' '.join(ARG)
417418
logging.info(f"Running command {exec_cmd!r} within chroot...")
@@ -423,7 +424,8 @@ chroot {TMP_MOUNT_DIR} mount -a;
423424
shell_exec(f"snapper -c {snapper_root_config} delete {atomic_snap}")
424425
cleanup()
425426
sys.exit(9)
426-
logging.info("Command run successfully")
427+
else:
428+
logging.info("Command run successfully")
427429
if SHELL:
428430
logging.info(f"Opening bash shell within chroot of snapshot {atomic_snap}")
429431
logging.info("Continue with 'exit 0' or discard with 'exit 1'")

0 commit comments

Comments
 (0)