diff --git a/virttest/utils_package.py b/virttest/utils_package.py index 17126f72f3..dd0838efe4 100644 --- a/virttest/utils_package.py +++ b/virttest/utils_package.py @@ -106,14 +106,21 @@ def operate(self, timeout, default_status, internal_timeout=2): need = True if need: cmd = self.cmd + pkg - if self.session.cmd_status(cmd, timeout, internal_timeout): + status, output = self.session.cmd_status_output(cmd, + timeout, + internal_timeout) + if status: + logging.error("'%s' execution failed " + "with %s", cmd, output) # Try to clean the repo db and re-try installation if not self.clean(): logging.error("Package %s was broken", self.package_manager) return False - if self.session.cmd_status(cmd, timeout): - logging.error("Operate %s with %s failed", pkg, cmd) + status, output = self.session.cmd_status_output(cmd, timeout) + if status: + logging.error("'%s' execution failed " + "with %s", cmd, output) return False return True