diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-07-07 20:27:31 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-07-07 20:27:31 +0100 |
commit | 097ec8787d99a92e17ee3ef03e7d4e9518a852e7 (patch) | |
tree | 66976d52ef60308bac62835740898c6e7d6823ab | |
parent | 9fdbd4fe40ba3aba203aeb14b5a064dc4e080874 (diff) | |
download | sos-097ec8787d99a92e17ee3ef03e7d4e9518a852e7.tar.gz |
[rpm] do not perform rpm -V unless --verify is given
Related: #304.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/rpm.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sos/plugins/rpm.py b/sos/plugins/rpm.py index bccb07d1..1177c187 100644 --- a/sos/plugins/rpm.py +++ b/sos/plugins/rpm.py @@ -42,17 +42,19 @@ class Rpm(Plugin, RedHatPlugin): shell_cmd = "sh -c '%s'" % (rpmq_cmd + "|" + filter_cmd) self.add_cmd_output(shell_cmd, root_symlink = "installed-rpms") - 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) - verify_pkgs = "" - for pkg_list in verify_list: - for pkg in pkg_list: - if 'debuginfo' in pkg or 'devel' in pkg: - continue - verify_pkgs = "%s %s" % (verify_pkgs, pkg) - self.add_cmd_output("rpm -V %s" % verify_pkgs) + if self.get_option("verify"): + 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) + verify_pkgs = "" + for pkg_list in verify_list: + for pkg in pkg_list: + if 'debuginfo' in pkg or 'devel' in pkg: + continue + verify_pkgs = "%s %s" % (verify_pkgs, pkg) + self.add_cmd_output("rpm -V %s" % verify_pkgs) + # vim: et ts=4 sw=4 |