aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2017-08-31 14:26:16 +0100
committerBryn M. Reeves <bmr@redhat.com>2017-11-01 14:17:59 +0000
commit04342ae8c1ac5fbad3b4179775ed37c670ac1480 (patch)
treeb16f9278485b2b6d78ce55c9209fe9f4de989efa
parent7f69d46e602dad0d50d9f94a21070db65f2623f8 (diff)
downloadsos-04342ae8c1ac5fbad3b4179775ed37c670ac1480.tar.gz
[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 <bmr@redhat.com>
-rw-r--r--sos/policies/__init__.py5
1 files changed, 5 insertions, 0 deletions
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: