Skip to content

Commit 6dd3c29

Browse files
committed
Fix pre-start checks
1 parent 477248f commit 6dd3c29

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.6"
31+
VERSION = "0.1.7"
3232
ZYPPER_PID_FILE = "/run/zypp.pid"
3333
VALID_CMD = ["dup", "run", "rollback"]
3434
VALID_OPT = ["--reboot", "--apply", "--shell", "--continue", "--no-verify", \
@@ -307,7 +307,7 @@ programs = ["zypper", "snapper", "btrfs", "echo", "ps", "sed", "awk", "bash", "s
307307
"env", "chroot", "mount", "umount", "rmdir", "findmnt", "systemd-nspawn", \
308308
"systemctl", "machinectl", "systemd-analyze"]
309309
for program in programs:
310-
if not shell_exec(f"command -v {program}"):
310+
if not shell_exec(f"command -v {program}")[0]:
311311
logging.error(f"Bailing out, missing required dependecy {program!r} in PATH ({os.environ.get('PATH')}) " \
312312
f"for user {os.environ.get('USER')!r}. The following programs " \
313313
f"are required for atomic-update to function: {', '.join(programs)}"
@@ -325,7 +325,7 @@ if os.path.isfile(ZYPPER_PID_FILE):
325325
except ValueError:
326326
pid = None
327327
if pid:
328-
pid_program = shell_exec(f"ps -p {pid} | sed '1d' | awk '{{print $4}}'")
328+
pid_program = shell_exec(f"ps -p {pid} | sed '1d' | awk '{{print $4}}'")[0]
329329
if pid_program:
330330
msg = f"zypper is already invoked by the application with pid {pid} ({pid_program}).\n" \
331331
"Close this application before trying again."

0 commit comments

Comments
 (0)