[elbe-devel] [PATCH 13/13] Change os.sytem to call_check for "virtapt.py"
dion at linutronix.de
dion at linutronix.de
Mon Jun 24 12:48:53 CEST 2019
From: Olivier Dion <dion at linutronix.de>
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/virtapt.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index e382c688..62a41b78 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -12,7 +12,7 @@ import os
import sys
from tempfile import mkdtemp
-
+from subprocess import check_call
from multiprocessing.managers import BaseManager
# don't remove the apt import, it is really needed, due to some magic in
@@ -128,7 +128,7 @@ class VirtApt(object):
print(e)
def __del__(self):
- os.system('rm -rf "%s"' % self.projectpath)
+ check_call('rm -rf "%s"' % self.projectpath, shell=True)
def start(self):
pass
@@ -153,7 +153,7 @@ class VirtApt(object):
else:
os.makedirs(newdir, mode)
# mode is not set correctly
- os.system("chmod 777 " + newdir)
+ check_call("chmod 777 " + newdir, shell=True)
def touch(self, fname):
if os.path.exists(fname):
--
2.11.0
More information about the elbe-devel
mailing list