diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-07-11 17:34:24 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-17 14:01:36 +0100 |
commit | 1b11a653d0be6128b26ea9421c783c6e78f7549b (patch) | |
tree | bf205a1eb44a30453b1c125c7d4e8b22876a2814 /scripts | |
parent | 96a87592d41c9813f7b8c4f87dd3acdd3933ae50 (diff) | |
download | poky-1b11a653d0be6128b26ea9421c783c6e78f7549b.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]
(From OE-Core rev: dac68d2323b0b630c019ce4d5256ed567eaf00da)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 5 |
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): | |||
676 | else: | 676 | else: |
677 | cmd = 'ls -t %s/*.qemuboot.conf' % deploy_dir_image | 677 | cmd = 'ls -t %s/*.qemuboot.conf' % deploy_dir_image |
678 | logger.info('Running %s...' % cmd) | 678 | logger.info('Running %s...' % cmd) |
679 | qbs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') | 679 | try: |
680 | qbs = subprocess.check_output(cmd, shell=True).decode('utf-8') | ||
681 | except subprocess.CalledProcessError as err: | ||
682 | raise RunQemuError(err) | ||
680 | if qbs: | 683 | if qbs: |
681 | for qb in qbs.split(): | 684 | for qb in qbs.split(): |
682 | # Don't use initramfs when other choices unless fstype is ramfs | 685 | # Don't use initramfs when other choices unless fstype is ramfs |