summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-03-23 10:37:59 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-25 09:39:26 +0000
commit3e5d04d9ebbee4e11fb39bf353b6d4c3133e166a (patch)
tree0a91aad03340c7d9c77afa0d3595268c3f03070c /scripts
parent701d985aa8f2e9c2b9c0736fa25b424f3701889e (diff)
downloadopenembedded-core-contrib-3e5d04d9ebbee4e11fb39bf353b6d4c3133e166a.tar.gz
runqemu: Fix TypeError when command fails
The commands passed to subprocess are tuples which when passed to a % format are treated as multiple format arguments instead of a single argument to be coerced by "%s". This results in a TypeError being raised with python claiming that not all arguments were consumed. Fix this by wrapping the command tuple in a str() call, as is done for the logging strings [YOCTO #15078] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index fee6b25b974..61a7f1820a6 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1042,7 +1042,7 @@ to your build configuration.
cmd = ('runqemu-extract-sdk', src, dest)
logger.info('Running %s...' % str(cmd))
if subprocess.call(cmd) != 0:
- raise RunQemuError('Failed to run %s' % cmd)
+ raise RunQemuError('Failed to run %s' % str(cmd))
self.rootfs = dest
self.cleanup_files.append(self.rootfs)
self.cleanup_files.append('%s.pseudo_state' % self.rootfs)
@@ -1051,7 +1051,7 @@ to your build configuration.
cmd = ('runqemu-export-rootfs', 'start', self.rootfs)
logger.info('Running %s...' % str(cmd))
if subprocess.call(cmd) != 0:
- raise RunQemuError('Failed to run %s' % cmd)
+ raise RunQemuError('Failed to run %s' % str(cmd))
self.nfs_running = True
@@ -1060,7 +1060,7 @@ to your build configuration.
if cmd != '':
logger.info('Running setup command %s' % str(cmd))
if subprocess.call(cmd, shell=True) != 0:
- raise RunQemuError('Failed to run %s' % cmd)
+ raise RunQemuError('Failed to run %s' % str(cmd))
def setup_net_bridge(self):
self.set('NETWORK_CMD', '-netdev bridge,br=%s,id=net0,helper=%s -device virtio-net-pci,netdev=net0 ' % (
@@ -1554,7 +1554,7 @@ to your build configuration.
if cmd != '':
logger.info('Running cleanup command %s' % str(cmd))
if subprocess.call(cmd, shell=True) != 0:
- raise RunQemuError('Failed to run %s' % cmd)
+ raise RunQemuError('Failed to run %s' % str(cmd))
def cleanup(self):
if self.cleaned:
@@ -1663,7 +1663,7 @@ to your build configuration.
return result
raise RunQemuError("Native sysroot directory %s doesn't exist" % result)
else:
- raise RunQemuError("Can't find STAGING_BINDIR_NATIVE in '%s' output" % cmd)
+ raise RunQemuError("Can't find STAGING_BINDIR_NATIVE in '%s' output" % str(cmd))
def main():