aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Quigley <bryan.quigley@canonical.com>2015-02-25 11:35:45 -0500
committerAdam Stokes <adam.stokes@ubuntu.com>2015-02-25 12:05:53 -0500
commit4b73a15fad61ed36191c118db12fcf5e80085959 (patch)
tree57be412e27fa7de9da4f71f7e531a7b8e3a8dd4b
parent1b15a70ddda3c0f12124a1f53398cc09412981bf (diff)
downloadsos-4b73a15fad61ed36191c118db12fcf5e80085959.tar.gz
[dpkg] Collect debconf db, add verify and all logs options
Collect debconf db, which is really dpkg configuration info Add verify option to dpkg, to verify and check. On a machine in a good state that only took 20 seconds or so. Add all logs option to collect more than the last dpkg log. Closes: #483 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r--sos/plugins/dpkg.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/sos/plugins/dpkg.py b/sos/plugins/dpkg.py
index 50c733e0..5327dbf8 100644
--- a/sos/plugins/dpkg.py
+++ b/sos/plugins/dpkg.py
@@ -24,7 +24,19 @@ class Dpkg(Plugin, DebianPlugin, UbuntuPlugin):
profiles = ('sysmgmt', 'packagemanager')
def setup(self):
- self.add_copy_spec("/var/log/dpkg.log")
self.add_cmd_output("dpkg -l", root_symlink="installed-debs")
+ if self.get_option("verify"):
+ self.add_cmd_output("dpkg -V")
+ self.add_cmd_output("dpkg -C")
+ self.add_copy_spec([
+ "/var/cache/debconf/config.dat",
+ "/etc/debconf.conf"
+ ])
+ if not self.get_option("all_logs"):
+ limit = self.get_option("log_size")
+ self.add_copy_spec_limit("/var/log/dpkg.log",
+ sizelimit=limit)
+ else:
+ self.add_copy_spec("/var/log/dpkg.log*")
# vim: et ts=4 sw=4