summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-08-20 10:41:27 +0300
committerLars Wirzenius <liw@liw.fi>2020-08-20 10:41:27 +0300
commit284d59a3e5eb280466901680dd2ec4fd5b0c52b9 (patch)
tree8fe371470c3beed8584767192f390d14ad3825aa
parent802db1821bf9b7341cdc129ce7d44ec2eded49d7 (diff)
downloadvmdb2-284d59a3e5eb280466901680dd2ec4fd5b0c52b9.tar.gz
refactor(unmount.py): use subprocess instead of cliapp.runcmd
-rw-r--r--vmdb/unmount.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/vmdb/unmount.py b/vmdb/unmount.py
index 2a9e5e9..c4ba00a 100644
--- a/vmdb/unmount.py
+++ b/vmdb/unmount.py
@@ -23,10 +23,7 @@
import logging
-
-import cliapp
-
-import vmdb
+import subprocess
def unmount(what, mounts=None, real_unmount=None):
@@ -50,9 +47,9 @@ def _read_proc_mounts(): # pragma: no cover
def _real_unmount(what): # pragma: no cover
try:
- vmdb.runcmd(["umount", what])
- except cliapp.AppException:
- logging.info("unmount failed, but ignoring that")
+ subprocess.check_call(["umount", what])
+ except subprocess.CalledProcessError as e:
+ logging.info("unmount failed, but ignoring that: %s", e)
def _parse_proc_mounts(text):