From ca38e1c70484cccb910ded92a5e769b6255c7b4a Mon Sep 17 00:00:00 2001 From: Srikanth Aithal Date: Thu, 27 Sep 2018 20:03:38 +0530 Subject: [PATCH] Enhance provides package feature in softwaremanager Currently on rhel based systems, if the name given for provides is not part of package name itself, provides method return none. We would have to handle situations where name is present in filenames, this commit adds functionality of searching packages based on filenames as well. Signed-off-by: Srikanth Aithal --- avocado/utils/software_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/avocado/utils/software_manager.py b/avocado/utils/software_manager.py index 3828a0c8..af9c359b 100644 --- a/avocado/utils/software_manager.py +++ b/avocado/utils/software_manager.py @@ -546,7 +546,9 @@ class YumBackend(RpmBackend): "yum module is required for this operation") return None try: - d_provides = self.yum_base.searchPackageProvides(args=[name]) + #Python API need to be passed globs along with name for searching + #all possible occurrences of pattern 'name' + d_provides = self.yum_base.searchPackageProvides(args=['*/' + name]) except Exception as exc: log.error("Error searching for package that " "provides %s: %s", name, exc) -- GitLab