From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/
Date: Sun, 22 May 2016 03:34:50 +0000 (UTC) [thread overview]
Message-ID: <1463722994.125ca190d30215de85fc3343c95784e658f75c37.vapier@gentoo> (raw)
commit: 125ca190d30215de85fc3343c95784e658f75c37
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 05:43:14 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri May 20 05:43:14 2016 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=125ca190
replace os.system with cmd
Use the existing cmd() helper for running external programs.
catalyst/base/stagebase.py | 11 ++++++-----
catalyst/fileops.py | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index f0f3ba9..6695ac4 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -967,16 +967,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
if not ismount(target):
continue
- retval=os.system("umount " + target)
-
- if retval!=0:
+ try:
+ cmd(['umount', target])
+ except CatalystError:
log.warning('First attempt to unmount failed: %s', target)
log.warning('Killing any pids still running in the chroot')
self.kill_chroot_pids()
- retval2 = os.system("umount " + target)
- if retval2!=0:
+ try:
+ cmd(['umount', target])
+ except CatalystError:
ouch=1
log.warning("Couldn't umount bind mount: %s", target)
diff --git a/catalyst/fileops.py b/catalyst/fileops.py
index 4b9e200..6971911 100644
--- a/catalyst/fileops.py
+++ b/catalyst/fileops.py
@@ -22,7 +22,7 @@ from snakeoil.osutils import (ensure_dirs as snakeoil_ensure_dirs,
# pylint: enable=unused-import
from catalyst import log
-from catalyst.support import CatalystError
+from catalyst.support import (cmd, CatalystError)
def ensure_dirs(path, gid=-1, uid=-1, mode=0o755, minimal=True,
@@ -79,7 +79,7 @@ def clear_dir(target, mode=0o755, chg_flags=False, remove=False,
mystat = os.stat(target)
# There's no easy way to change flags recursively in python
if chg_flags and os.uname()[0] == "FreeBSD":
- os.system("chflags -R noschg " + target)
+ cmd(['chflags', '-R', 'noschg', target])
log.debug('shutil.rmtree()')
shutil.rmtree(target)
except Exception:
next reply other threads:[~2016-05-22 3:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-22 3:34 Mike Frysinger [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-07-01 19:27 [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/ Andreas K. Hüttel
2021-02-28 14:39 Andreas K. Hüttel
2021-02-20 21:27 Matt Turner
2020-10-30 22:41 Matt Turner
2020-04-17 19:52 Matt Turner
2020-04-13 20:36 Matt Turner
2020-01-27 18:52 Rick Farina
2016-03-23 16:38 Brian Dolbec
2016-03-21 5:15 Mike Frysinger
2015-10-08 20:02 Brian Dolbec
2015-09-08 14:14 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-09-08 14:17 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-01-01 5:59 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-02-26 20:12 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-01-01 5:59 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-02-26 4:12 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463722994.125ca190d30215de85fc3343c95784e658f75c37.vapier@gentoo \
--to=vapier@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox