summaryrefslogtreecommitdiff
path: root/scripts/parallel_emerge.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2014-11-01 13:09:26 -0400
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-04 21:34:16 +0000
commite2d8f0d89ff451a160734f5cc6442eac09abe22f (patch)
treea974e51b869f8974ea5cd15d6237d9ddad9f4db6 /scripts/parallel_emerge.py
parentd8e30dc2d2ed03a629792e42b4afed5d2e091955 (diff)
downloadchromite-e2d8f0d89ff451a160734f5cc6442eac09abe22f.tar.gz
namespaces: refactor CreatePidNs
Pull out the pid namespace logic out of cros_sdk so other utilities can easily utilize it. The code isn't specific to cros_sdk at all as is. To facilitate this, start a new process_util module and move the helpers GetExitStatus and ExitAsStatus helpers there. Once we're done shuffling code around, start some unittests. There are no unittests for CreatePidNs though because it requires root access, and it often wants newer kernels. Will have to figure this out eventually. BUG=None TEST=`./cbuildbot/run_tests` passes TEST=`cros_sdk` still launches in a unique pid namespace Change-Id: I3d69d7fea8906f401b65cf544047e401b3a8017c Reviewed-on: https://chromium-review.googlesource.com/226960 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'scripts/parallel_emerge.py')
-rw-r--r--scripts/parallel_emerge.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/parallel_emerge.py b/scripts/parallel_emerge.py
index dc4676e3d..6287c8fa5 100644
--- a/scripts/parallel_emerge.py
+++ b/scripts/parallel_emerge.py
@@ -37,7 +37,7 @@ import time
import traceback
from chromite.lib import cros_build_lib
-from chromite.lib import osutils
+from chromite.lib import process_util
from chromite.lib import proctitle
# If PORTAGE_USERNAME isn't specified, scrape it from the $HOME variable. On
@@ -1399,7 +1399,7 @@ class EmergeQueue(object):
try:
# Wait for the process to exit. When it does, exit with the return
# value of the subprocess.
- os._exit(osutils.GetExitStatus(os.waitpid(pid, 0)[1]))
+ os._exit(process_util.GetExitStatus(os.waitpid(pid, 0)[1]))
except OSError as ex:
if ex.errno == errno.EINTR:
continue