aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Desrochers <eric.desrochers@canonical.com>2020-03-15 13:54:39 -0400
committerBryan Quigley <bryan.quigley@canonical.com>2020-03-16 09:35:33 -0700
commitf7469b2f316281c49e574467e41002f4b479b082 (patch)
treeca00306e3f7689284e6c9ee5f5397735536eed2b
parentd12fc6db69c4cd372b6199ff77130d197fadbede (diff)
downloadsos-f7469b2f316281c49e574467e41002f4b479b082.tar.gz
[lxd] Drop db collection and introduce lxd.buginfo
The content of lxd database is rarely useful unless DB corruption and can get very large. This can be run manually if needed (outside sosreport) lxd.buginfo command only available via SNAP installation, would have the advantage of not needing updates whenever lxd upstream add a new feature or find something new that’s worth capturing. LXD upstream reference: https://discuss.linuxcontainers.org/t/what-lxd-information-should-be-collected-by-sosreport https://github.com/lxc/lxd-pkg-snap/issues/14 Resolves: #1982 Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
-rw-r--r--sos/plugins/lxd.py44
1 files changed, 18 insertions, 26 deletions
diff --git a/sos/plugins/lxd.py b/sos/plugins/lxd.py
index ae004d0e..e76e9427 100644
--- a/sos/plugins/lxd.py
+++ b/sos/plugins/lxd.py
@@ -19,34 +19,26 @@ class LXD(Plugin, UbuntuPlugin):
packages = ('lxd',)
commands = ('lxd',)
- # Version 2.0.X:
- # - /etc/default/lxd-bridge
- # - /var/lib/lxd/lxd.db
- #
- # Version 3.0.X:
- # - /var/lib/lxd/database/local.db
- # - /var/lib/lxd/database/global/*
- # - lxd-bridge no longer exist.
- #
def setup(self):
- self.add_copy_spec([
- "/etc/default/lxd-bridge",
- "/var/lib/lxd/lxd.db",
- "/var/lib/lxd/database/local.db",
- "/var/lib/lxd/database/global/*",
- "/var/log/lxd/*"
- ])
+ snap_list = self.exec_cmd('snap list lxd')
+ if snap_list["status"] == 0:
+ self.add_cmd_output("lxd.buginfo")
+ else:
+ self.add_copy_spec([
+ "/etc/default/lxd-bridge",
+ "/var/log/lxd/*"
+ ])
- self.add_cmd_output([
- "lxc image list",
- "lxc list",
- "lxc network list",
- "lxc profile list",
- "lxc storage list"
- ])
+ self.add_cmd_output([
+ "lxc image list",
+ "lxc list",
+ "lxc network list",
+ "lxc profile list",
+ "lxc storage list"
+ ])
- self.add_cmd_output([
- "find /var/lib/lxd -maxdepth 2 -type d -ls",
- ], suggest_filename='var-lxd-dirs.txt')
+ self.add_cmd_output([
+ "find /var/lib/lxd -maxdepth 2 -type d -ls",
+ ], suggest_filename='var-lxd-dirs.txt')
# vim: set et ts=4 sw=4 :