[elbe-devel] [PATCH v2 11/15] Change os.sytem to shellhelper::system for "updated.py"

dion at linutronix.de dion at linutronix.de
Mon Jun 24 17:39:08 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/updated.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/elbepack/updated.py b/elbepack/updated.py
index adad4cce..343309ca 100644
--- a/elbepack/updated.py
+++ b/elbepack/updated.py
@@ -35,6 +35,7 @@ from elbepack.aptprogress import (ElbeInstallProgress,
                                   ElbeAcquireProgress, ElbeOpProgress)
 from elbepack.egpg import unsign_file
 from elbepack.treeutils import etree
+from elbepack.shellhelper import system
 
 downgrade_prevention_feature_available = True
 try:
@@ -180,14 +181,14 @@ class rw_access(object):
         if self.mount_orig == 'ro':
             self.status.log("remount %s read/writeable" % self.mount)
             cmd = "mount -o remount,rw %s" % self.mount
-            os.system(cmd)
+            system(cmd)
 
     def __exit__(self, _typ, _value, _traceback):
         if self.mount_orig == 'ro':
             self.status.log("remount %s readonly" % self.mount)
-            os.system("sync")
+            system("sync")
             cmd = "mount -o remount,ro %s" % self.mount
-            ret = os.system(cmd)
+            system(cmd)
 
     def get_mount_status(self):
         with open('/etc/mtab') as mtab:
@@ -430,7 +431,7 @@ def apply_update(fname, status):
         status.log("cleanup /var/cache/apt/archives")
         # don't use execute() here, it results in an error that the apt-cache
         # is locked. We currently don't understand this behaviour :(
-        os.system("apt-get clean")
+        system("apt-get clean")
         if p.exitcode != 0:
             raise Exception(
                 "Applying update failed. See logfile for more information")
-- 
2.11.0




More information about the elbe-devel mailing list