From c22f45622abba6380c77b33c0c153dcaf16d3f77 Mon Sep 17 00:00:00 2001 From: Kylazhang Date: Mon, 19 Mar 2018 12:10:29 +0800 Subject: [PATCH] Add interval for package install to avoid no exit status issues Signed-off-by: Kylazhang --- virttest/utils_package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virttest/utils_package.py b/virttest/utils_package.py index f7e9a46181..a68d9a31b5 100644 --- a/virttest/utils_package.py +++ b/virttest/utils_package.py @@ -82,7 +82,7 @@ def is_installed(self, pkg_name): cmd = self.query_cmd + pkg_name return not self.session.cmd_status(cmd) - def operate(self, timeout, default_status): + def operate(self, timeout, default_status, internal_timeout=2): """ Run command and return status @@ -99,7 +99,7 @@ def operate(self, timeout, default_status): need = True if need: cmd = self.cmd + pkg - if self.session.cmd_status(cmd, timeout): + if self.session.cmd_status(cmd, timeout, internal_timeout): # Try to clean the repo db and re-try installation if not self.clean(): logging.error("Package %s was broken", self.package_manager)