From 1b3fc3f029ed3ab1dcbfeaaaa8fe1616dbc3744f Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Tue, 30 Jul 2013 19:30:13 +0100 Subject: 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 --- sos/plugins/rpm.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- cgit