From 1ac4bc2a4758d330bb94cd1b2391121cf461ff6a Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Mon, 11 Sep 2017 10:29:19 -0700 Subject: tests: execute: support command as string If a string is passed to execute, then invoke 'bash', '-c', 'string'. That allows the less verbose execution of simple commands: image.execute("ls /run") compared to the more explicit but longer winded: image.execute(["ls", "/run"]) If 'env' was ever modified in execute or a method that it called, then the next invocation's default value would be changed. Instead use None and then set to a new empty dict in the method. --- tests/cloud_tests/bddeb.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/cloud_tests/bddeb.py') diff --git a/tests/cloud_tests/bddeb.py b/tests/cloud_tests/bddeb.py index fe805356..fba8a0c7 100644 --- a/tests/cloud_tests/bddeb.py +++ b/tests/cloud_tests/bddeb.py @@ -28,8 +28,7 @@ def build_deb(args, instance): # update remote system package list and install build deps LOG.debug('installing pre-reqs') pkgs = ' '.join(pre_reqs) - cmd = 'apt-get update && apt-get install --yes {}'.format(pkgs) - instance.execute(['/bin/sh', '-c', cmd]) + instance.execute('apt-get update && apt-get install --yes {}'.format(pkgs)) # local tmpfile that must be deleted local_tarball = tempfile.NamedTemporaryFile().name -- cgit v1.2.3