diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 17:43:40 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 23:30:44 +0000 |
commit | ad750dd1cc9d789abe723daddd098ce41d8547f5 (patch) | |
tree | a04de472a68fb60b1a783b3065cd06f6e096a44e /meta/lib/oeqa/utils | |
parent | da58e27a0f8fc8200f1953f05888834abd79c9f8 (diff) | |
download | openembedded-core-contrib-ad750dd1cc9d789abe723daddd098ce41d8547f5.tar.gz |
classes/oeqa: Replace subprocess.check_call() with check_output()
If you use subprocess.check_output() the traceback will contain the output
when the command fails which is very useful for debugging. There is no
good reason not to use this everywhere.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r-- | meta/lib/oeqa/utils/buildproject.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/targetbuild.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oeqa/utils/buildproject.py b/meta/lib/oeqa/utils/buildproject.py index 386a927881..b3c487b6c6 100644 --- a/meta/lib/oeqa/utils/buildproject.py +++ b/meta/lib/oeqa/utils/buildproject.py @@ -29,7 +29,7 @@ class BuildProject(metaclass=ABCMeta): return cmd = "wget -O %s %s" % (self.localarchive, self.uri) - subprocess.check_call(cmd, shell=True) + subprocess.check_output(cmd, shell=True) # This method should provide a way to run a command in the desired environment. @abstractmethod diff --git a/meta/lib/oeqa/utils/targetbuild.py b/meta/lib/oeqa/utils/targetbuild.py index c001602b54..6f237b56f3 100644 --- a/meta/lib/oeqa/utils/targetbuild.py +++ b/meta/lib/oeqa/utils/targetbuild.py @@ -45,7 +45,7 @@ class BuildProject(metaclass=ABCMeta): cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) cmd = cmd + "wget -O %s %s" % (self.localarchive, self.uri) - subprocess.check_call(cmd, shell=True) + subprocess.check_output(cmd, shell=True) # This method should provide a way to run a command in the desired environment. @abstractmethod @@ -114,7 +114,7 @@ class SDKBuildProject(BuildProject): self._download_archive() cmd = 'tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir) - subprocess.check_call(cmd, shell=True) + subprocess.check_output(cmd, shell=True) #Change targetdir to project folder self.targetdir = os.path.join(self.targetdir, self.fname) |