Skip to content

Commit d1b3c21

Browse files
committed
Fix install_distro_packages() to return True when packages already installed
The function was returning False when all required packages were already installed, which caused ensure_tool() to incorrectly raise RuntimeError. This fix ensures the function returns True when packages are available, regardless of whether they were just installed or already present. Signed-off-by: Disha Goel <disgoel@linux.ibm.com>
1 parent 43b9216 commit d1b3c21

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

avocado/utils/software_manager/distro_packages.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def install_distro_packages(distro_pkg_map, interactive=False):
2222
:type distro_pkg_map: dict
2323
:param distro_pkg_map: mapping of distro name, as returned by
2424
utils.get_os_vendor(), to a list of package names
25-
:return: True if any packages were actually installed, False otherwise
25+
:return: True if all required packages are available (either just
26+
installed or already present), False otherwise
2627
"""
2728
if not interactive:
2829
os.environ["DEBIAN_FRONTEND"] = "noninteractive"
@@ -72,6 +73,9 @@ def install_distro_packages(distro_pkg_map, interactive=False):
7273
text = " ".join(needed_pkgs)
7374
log.info('Installing packages "%s"', text)
7475
result = software_manager.install(text)
76+
else:
77+
log.info("All required packages already installed")
78+
result = True
7579
return result
7680

7781

0 commit comments

Comments
 (0)