aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-10-21 17:23:27 -0700
committerChris Larson <chris_larson@mentor.com>2010-10-21 18:52:06 -0700
commit1c164de88d35a46eaa6a9414de58384493c1196a (patch)
treea561a9a9399e13bb7dd89509308fa97ac11229fb /lib
parent7e4958f03ee2a76da2b86b913cdcb5c0ca21ce8b (diff)
downloadopenembedded-1c164de88d35a46eaa6a9414de58384493c1196a.tar.gz
openembedded-1c164de88d35a46eaa6a9414de58384493c1196a.tar.bz2
openembedded-1c164de88d35a46eaa6a9414de58384493c1196a.zip
oe.process: allow passing input into run()
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/oe/process.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/oe/process.py b/lib/oe/process.py
index 63b14571af..26c3e65910 100644
--- a/lib/oe/process.py
+++ b/lib/oe/process.py
@@ -55,7 +55,7 @@ class Popen(subprocess.Popen):
options.update(kwargs)
subprocess.Popen.__init__(self, *args, **options)
-def run(cmd, **options):
+def run(cmd, input=None, **options):
"""Convenience function to run a command and return its output, raising an
exception when the command fails"""
@@ -68,7 +68,7 @@ def run(cmd, **options):
raise NotFoundError(cmd)
else:
raise
- stdout, stderr = pipe.communicate()
+ stdout, stderr = pipe.communicate(input)
if pipe.returncode != 0:
raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
return stdout