diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-08-20 11:02:56 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-08-20 11:02:56 +0300 |
commit | 2d2ad0d6d34ccd31ebd3db9c022ab102e46e946f (patch) | |
tree | 61b5dcaebfe70b0c01b31068666f52d5015fe852 | |
parent | 7a8c845a3352c5c57039d5f476dc2037c1562305 (diff) | |
download | vmdb2-2d2ad0d6d34ccd31ebd3db9c022ab102e46e946f.tar.gz |
fix(runcmd.py): use subprocess, fix syntax error
-rw-r--r-- | vmdb/runcmd.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vmdb/runcmd.py b/vmdb/runcmd.py index 985a717..13e2c4e 100644 --- a/vmdb/runcmd.py +++ b/vmdb/runcmd.py @@ -21,8 +21,6 @@ import os import subprocess import sys -import cliapp - _verbose = False @@ -57,7 +55,7 @@ def runcmd(argv, **kwargs): logging.debug("STDOUT: %s", out.decode("UTF8")) logging.debug("STDERR: %s", err.decode("UTF8")) if p.returncode != 0: - raise cliapp.AppException("Command failed: {}".format(p.returncode)) + raise subprocess.CalledProgramError("Command failed: {}".format(p.returncode)) return out @@ -69,7 +67,7 @@ def runcmd_chroot(chroot, argv, *argvs, **kwargs): def _procdir(chroot): proc = os.path.join(chroot, "proc") if not os.path.exists(proc): - os.mkdir(proc, mode=Oo755) + os.mkdir(proc, mode=0o755) return proc |