aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-04-06 18:00:32 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-04-06 18:00:32 +0100
commitc2d90b7db3b72fb58704108bda27f58e9a68b347 (patch)
tree9e4870ff768698272d63066f01972ce7e45e3f8d
parent12989650c3bf05996d0e62bc13c648c715fe24f7 (diff)
downloadsos-c2d90b7db3b72fb58704108bda27f58e9a68b347.tar.gz
Make rpm plugin call sh -c'...'
The rpm plugin is the last user of shell syntax. For now have it call its pipeline explicitly using sh -c '...'. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/rpm.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sos/plugins/rpm.py b/sos/plugins/rpm.py
index 6c1529c2..3569434a 100644
--- a/sos/plugins/rpm.py
+++ b/sos/plugins/rpm.py
@@ -35,12 +35,12 @@ class Rpm(Plugin, RedHatPlugin):
self.add_copy_spec("/var/log/rpmpkgs")
if self.get_option("rpmq"):
- self.add_cmd_output("rpm -qa --qf="
- "\"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}~~"
- "%{INSTALLTIME:date}\t%{INSTALLTIME}\t%{VENDOR}\n\""
- " --nosignature --nodigest | awk -F '~~' "
- "'{printf \"%-59s %s\\n\",$1,$2}'|sort",
- root_symlink = "installed-rpms")
+ query_fmt = '"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}'
+ query_fmt = query_fmt + '~~%{INSTALLTIME:date}\t%{INSTALLTIME}\t%{VENDOR}\n"'
+ rpmq_cmd = "rpm --nosignature --nodigest -qa --qf=%s" % query_fmt
+ filter_cmd = 'awk -F "~~" "{printf \\"%-59s %s\\n\\",\$1,\$2}"|sort'
+ 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)