aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-07-11 17:34:24 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-17 13:48:52 +0100
commitdac68d2323b0b630c019ce4d5256ed567eaf00da (patch)
treecc3d283e96b11a6a940aaca06003c89da1d598d3 /scripts/runqemu
parenta779a382b66e7b43ac53286758b4370dc14b193b (diff)
downloadopenembedded-core-contrib-dac68d2323b0b630c019ce4d5256ed567eaf00da.tar.gz
runqemu: check exit code of 'ls -t'
Used check_output instead of Popen as it raises CalledProcessError exception when command exits with non-zero exit code. Catched the exception to produce user-friendly output. [YOCTO #11719] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index c33741d804..d44afc7e7a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -676,7 +676,10 @@ class BaseConfig(object):
else:
cmd = 'ls -t %s/*.qemuboot.conf' % deploy_dir_image
logger.info('Running %s...' % cmd)
- qbs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ try:
+ qbs = subprocess.check_output(cmd, shell=True).decode('utf-8')
+ except subprocess.CalledProcessError as err:
+ raise RunQemuError(err)
if qbs:
for qb in qbs.split():
# Don't use initramfs when other choices unless fstype is ramfs