commit f9c24a2e75a81965dc82b528d73d71582fa68803 Author: Bryn M. Reeves Date: Tue Aug 13 22:15:35 2013 +0100 Add restricted rpm verify Backport of commit 1b3fc3f. 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 diff --git a/sos/plugins/rpm.py b/sos/plugins/rpm.py index b02d6a3..81e057b 100644 --- a/sos/plugins/rpm.py +++ b/sos/plugins/rpm.py @@ -19,6 +19,14 @@ class rpm(sos.plugintools.PluginBase): """ optionList = [("rpmq", "queries for package information via rpm -q", "fast", True), ("rpmva", "runs a verify on all packages", "slow", False)] + + verify_list = [ + 'kernel', 'glibc', 'initscripts', + 'pam_.*', + 'java.*', 'perl.*', + 'rpm', 'yum', + 'spacewalk.*' + ] def setup(self): self.addCopySpec("/var/log/rpmpkgs") @@ -28,5 +36,14 @@ class rpm(sos.plugintools.PluginBase): if self.getOption("rpmva"): self.collectExtOutput("/bin/rpm -Va", symlink = "rpm-Va", timeout = 3600) + else: + pkgs_by_regex = self.policy().allPkgsByNameRegex + verify_list = map(pkgs_by_regex, self.verify_list) + for pkg_list in verify_list: + for pkg in pkg_list: + if pkg['name'].endswith('-debuginfo') or \ + pkg['name'].endswith('-debuginfo-common'): + continue + self.collectExtOutput("rpm -V %s" % pkg['name']) return