summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch')
-rw-r--r--meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch21
1 files changed, 11 insertions, 10 deletions
diff --git a/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch b/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch
index fea225407..5b388599b 100644
--- a/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch
+++ b/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch
@@ -1,20 +1,20 @@
-From 596979ed58109141a7fee680ab95b27296c022b1 Mon Sep 17 00:00:00 2001
+From 713cf821ebe17f9e1771502a85e0905ea04dafae Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Mon, 8 May 2017 14:39:56 +0800
+Date: Fri, 23 Nov 2018 17:03:58 +0800
Subject: [PATCH 02/11] run_program support timeout
Upstream-Status: Pending
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
- blivet/util.py | 68 +++++++++++++++++++++++++++++++++-------------------------
- 1 file changed, 39 insertions(+), 29 deletions(-)
+ blivet/util.py | 70 ++++++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 41 insertions(+), 29 deletions(-)
diff --git a/blivet/util.py b/blivet/util.py
-index 0f2a995..05a253c 100644
+index 4eac8b9..4f05076 100644
--- a/blivet/util.py
+++ b/blivet/util.py
-@@ -157,6 +157,30 @@ class Path(str):
+@@ -158,6 +158,30 @@ class Path(str):
def __hash__(self):
return self._path.__hash__()
@@ -45,12 +45,12 @@ index 0f2a995..05a253c 100644
def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False):
if env_prune is None:
-@@ -179,36 +203,22 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
+@@ -180,35 +204,23 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
stderr_dir = subprocess.STDOUT
else:
stderr_dir = subprocess.PIPE
- try:
-- proc = subprocess.Popen(argv,
+- proc = subprocess.Popen(argv, # pylint: disable=subprocess-popen-preexec-fn
- stdin=stdin,
- stdout=subprocess.PIPE,
- stderr=stderr_dir,
@@ -78,7 +78,7 @@ index 0f2a995..05a253c 100644
- program_log.debug("Return code: %d", proc.returncode)
-
- return (proc.returncode, out)
-
++
+ res, out = timeout_command(argv, 10,
+ stdin=stdin,
+ stdout=subprocess.PIPE,
@@ -94,9 +94,10 @@ index 0f2a995..05a253c 100644
+ program_log.info("%s", line)
+
+ return (res, out)
++
+
def run_program(*args, **kwargs):
- return _run_program(*args, **kwargs)[0]
--
2.7.4
OpenPOWER on IntegriCloud