aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2013-07-30 19:30:13 +0100
committerBryn M. Reeves <bmr@redhat.com>2013-07-30 19:30:13 +0100
commit1b3fc3f029ed3ab1dcbfeaaaa8fe1616dbc3744f (patch)
treeb40fc5c3efbec5f169f2d572ea12db42060de74f
parent70997bc11f3d07ba206569721a3fe79d3af942f6 (diff)
downloadsos-1b3fc3f029ed3ab1dcbfeaaaa8fe1616dbc3744f.tar.gz
Add restricted rpm verify
Add a default call to rpm -V/--verify for a targeted subset of packages. This greatly reduces the time taken relative to rpm -Va while still capturing important diagnostic information. In future this capability could be made a feature of the PackageManager class interface and available to all ports/modules. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/rpm.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sos/plugins/rpm.py b/sos/plugins/rpm.py
index 9d44fde2..a3150188 100644
--- a/sos/plugins/rpm.py
+++ b/sos/plugins/rpm.py
@@ -23,6 +23,8 @@ class Rpm(Plugin, RedHatPlugin):
option_list = [("rpmq", "queries for package information via rpm -q", "fast", True),
("rpmva", "runs a verify on all packages", "slow", False)]
+ verify_list = [ 'kernel', 'glibc', 'pam_.*' ]
+
def setup(self):
self.add_copy_spec("/var/log/rpmpkgs")
@@ -36,3 +38,9 @@ class Rpm(Plugin, RedHatPlugin):
if self.get_option("rpmva"):
self.add_cmd_output("rpm -Va", root_symlink = "rpm-Va", timeout = 3600)
+ else:
+ pkgs_by_regex = self.policy().package_manager.all_pkgs_by_name_regex
+ verify_list = map(pkgs_by_regex, self.verify_list)
+ for pkg_list in verify_list:
+ for pkg in pkg_list:
+ self.add_cmd_output("rpm -V %s" % pkg)