From 04342ae8c1ac5fbad3b4179775ed37c670ac1480 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 31 Aug 2017 14:26:16 +0100 Subject: [policy] do not generate empty verify commands If after applying regex matching to the list of verify_packages there are no package names remaining, do not construct a verify command. Signed-off-by: Bryn M. Reeves --- sos/policies/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 087cf6a7..dffd801c 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -154,6 +154,11 @@ class PackageManager(object): by_regex = self.all_pkgs_by_name_regex verify_list = map(by_regex, packages) + + # No packages after regex match? + if not verify_list: + return None + verify_packages = "" for package_list in verify_list: for package in package_list: -- cgit