|
|
0cd6dc |
From b0938e14eedd33c5c82d9d745310792d4a249c72 Mon Sep 17 00:00:00 2001
|
|
|
0cd6dc |
From: Louis Bouchard <louis.bouchard@canonical.com>
|
|
|
0cd6dc |
Date: Thu, 2 Oct 2014 17:41:48 +0200
|
|
|
0cd6dc |
Subject: [PATCH 07/93] [apt] Fix failing apt-cache policy details
|
|
|
0cd6dc |
|
|
|
0cd6dc |
Split add_cmd_output to use suggest_filename since the
|
|
|
0cd6dc |
output of apt-cache policy for each installed package
|
|
|
0cd6dc |
would create an incredibly long filename.
|
|
|
0cd6dc |
|
|
|
0cd6dc |
Fixes #415.
|
|
|
0cd6dc |
|
|
|
0cd6dc |
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
|
|
|
0cd6dc |
---
|
|
|
0cd6dc |
sos/plugins/apt.py | 17 ++++++++++-------
|
|
|
0cd6dc |
1 file changed, 10 insertions(+), 7 deletions(-)
|
|
|
0cd6dc |
|
|
|
0cd6dc |
diff --git a/sos/plugins/apt.py b/sos/plugins/apt.py
|
|
|
0cd6dc |
index 091d30f..bd0b336 100644
|
|
|
0cd6dc |
--- a/sos/plugins/apt.py
|
|
|
0cd6dc |
+++ b/sos/plugins/apt.py
|
|
|
0cd6dc |
@@ -29,17 +29,20 @@ class Apt(Plugin, DebianPlugin, UbuntuPlugin):
|
|
|
0cd6dc |
"/etc/apt", "/var/log/apt"
|
|
|
0cd6dc |
])
|
|
|
0cd6dc |
|
|
|
0cd6dc |
- dpkg_result = self.call_ext_prog(
|
|
|
0cd6dc |
- "dpkg-query -W -f='${binary:Package}\t${status}\n'")
|
|
|
0cd6dc |
- dpkg_output = dpkg_result['output'].splitlines()
|
|
|
0cd6dc |
- pkg_list = ' '.join(
|
|
|
0cd6dc |
- [v.split('\t')[0] for v in dpkg_output if 'ok installed' in v])
|
|
|
0cd6dc |
self.add_cmd_output([
|
|
|
0cd6dc |
"apt-get check",
|
|
|
0cd6dc |
"apt-config dump",
|
|
|
0cd6dc |
"apt-cache stats",
|
|
|
0cd6dc |
- "apt-cache policy",
|
|
|
0cd6dc |
- "apt-cache policy {}".format(pkg_list)
|
|
|
0cd6dc |
+ "apt-cache policy"
|
|
|
0cd6dc |
])
|
|
|
0cd6dc |
+ dpkg_result = self.call_ext_prog(
|
|
|
0cd6dc |
+ "dpkg-query -W -f='${binary:Package}\t${status}\n'")
|
|
|
0cd6dc |
+ dpkg_output = dpkg_result['output'].splitlines()
|
|
|
0cd6dc |
+ pkg_list = ' '.join(
|
|
|
0cd6dc |
+ [v.split('\t')[0] for v in dpkg_output if 'ok installed' in v])
|
|
|
0cd6dc |
+ self.add_cmd_output(
|
|
|
0cd6dc |
+ "apt-cache policy {}".format(pkg_list),
|
|
|
0cd6dc |
+ suggest_filename="apt-cache_policy_details"
|
|
|
0cd6dc |
+ )
|
|
|
0cd6dc |
|
|
|
0cd6dc |
# vim: et ts=4 sw=4
|
|
|
0cd6dc |
--
|
|
|
0cd6dc |
1.9.3
|
|
|
0cd6dc |
|