aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Desrochers <eric.desrochers@canonical.com>2019-04-23 16:07:03 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-09-25 14:47:24 +0100
commit1ec2b7b6f088e65a9232d063eb6b53d248de476f (patch)
treef1f20f7e9339a3d2283addd51afe95e349abcc05
parentc8517e83b91f2c6f615ddca5a9a62c0a6eade9ee (diff)
downloadsos-1ec2b7b6f088e65a9232d063eb6b53d248de476f.tar.gz
[lxd] adapting the plugin to support lxd 3.0.X series
Enable proper collection for LXD 3.0.X, while staying backward compatible with LXD 2.0.X which can still be used with Xenial/16.04 LTS only. Resolves: #1659 Signed-off-by: Eric Desrochers eric.desrochers@canonical.com Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/lxd.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/sos/plugins/lxd.py b/sos/plugins/lxd.py
index ce831e00..02ff7073 100644
--- a/sos/plugins/lxd.py
+++ b/sos/plugins/lxd.py
@@ -18,19 +18,30 @@ class LXD(Plugin, UbuntuPlugin):
profiles = ('container',)
packages = ('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",
- "/etc/default/lxc-bridge",
+ "/var/lib/lxd/database/local.db",
+ "/var/lib/lxd/database/global/*",
+ "/var/log/lxd/*"
])
- self.add_copy_spec("/var/log/lxd*")
-
- # List of containers available on the machine
self.add_cmd_output([
+ "lxc image list",
"lxc list",
+ "lxc network list",
"lxc profile list",
- "lxc image list",
+ "lxc storage list"
])
self.add_cmd_output([