diff options
author | Louis Bouchard <louis.bouchard@canonical.com> | 2014-10-02 17:41:48 +0200 |
---|---|---|
committer | Louis Bouchard <louis.bouchard@canonical.com> | 2014-10-13 11:19:17 +0200 |
commit | b0938e14eedd33c5c82d9d745310792d4a249c72 (patch) | |
tree | 8a40698632ef26dbbafa83da5cfc5da7fddf3281 | |
parent | 82f1ae00d5c6f5b293c818a38eccf633452a8b96 (diff) | |
download | sos-b0938e14eedd33c5c82d9d745310792d4a249c72.tar.gz |
[apt] Fix failing apt-cache policy details
Split add_cmd_output to use suggest_filename since the
output of apt-cache policy for each installed package
would create an incredibly long filename.
Fixes #415.
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
-rw-r--r-- | sos/plugins/apt.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sos/plugins/apt.py b/sos/plugins/apt.py index 091d30ff..bd0b3365 100644 --- a/sos/plugins/apt.py +++ b/sos/plugins/apt.py @@ -29,17 +29,20 @@ class Apt(Plugin, DebianPlugin, UbuntuPlugin): "/etc/apt", "/var/log/apt" ]) - dpkg_result = self.call_ext_prog( - "dpkg-query -W -f='${binary:Package}\t${status}\n'") - dpkg_output = dpkg_result['output'].splitlines() - pkg_list = ' '.join( - [v.split('\t')[0] for v in dpkg_output if 'ok installed' in v]) self.add_cmd_output([ "apt-get check", "apt-config dump", "apt-cache stats", - "apt-cache policy", - "apt-cache policy {}".format(pkg_list) + "apt-cache policy" ]) + dpkg_result = self.call_ext_prog( + "dpkg-query -W -f='${binary:Package}\t${status}\n'") + dpkg_output = dpkg_result['output'].splitlines() + pkg_list = ' '.join( + [v.split('\t')[0] for v in dpkg_output if 'ok installed' in v]) + self.add_cmd_output( + "apt-cache policy {}".format(pkg_list), + suggest_filename="apt-cache_policy_details" + ) # vim: et ts=4 sw=4 |