Skip to content

Commit 097367d

Browse files
committed
[lxd] Fixed commands for snap in lxd.py + added missing commands
The LXD plugin for sos had 2 main issues: 1. It was lacking in troubleshooting commands. For verifying cluster quorum & health and for more information I have since added: - lxc operation list - lxc info - lxc alias list - lxc remote list - lxc version - lxc warning list - lxc auth permission list - lxc cluster list All command use the local: remote. 2. The ‘snap’ section of the plugin was broken and did not capture much of anything except lxd.buginfo and the few lxc commands included only worked on debs. This has been changed to work on both the debian package and snap version of LXD. Signed-off-by: Ryan Molkentin <[email protected]>
1 parent 3c97985 commit 097367d

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

sos/report/plugins/lxd.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ class LXD(Plugin, UbuntuPlugin):
2222
services = ('snap.lxd.daemon', 'snap.lxd.activate')
2323

2424
def setup(self):
25+
26+
lxc_cmds = [
27+
"lxc image list local:",
28+
"lxc list local:",
29+
"lxc network list local:",
30+
"lxc profile list local:",
31+
"lxc storage list local:",
32+
"lxc operation list local:",
33+
"lxc info local:",
34+
"lxc alias list",
35+
"lxc config show local:",
36+
"lxc remote list",
37+
"lxc version local:",
38+
"lxc warning list local:",
39+
"lxc auth permission list local:",
40+
"lxc cluster list local:"
41+
]
42+
2543
if self.is_snap:
2644

2745
lxd_pred = SoSPredicate(self, services=['snap.lxd.daemon'],
@@ -110,18 +128,12 @@ def setup(self):
110128
"/var/log/lxd/*"
111129
])
112130

113-
self.add_cmd_output([
114-
"lxc image list",
115-
"lxc list",
116-
"lxc network list",
117-
"lxc profile list",
118-
"lxc storage list"
119-
], pred=lxd_pred)
120-
121131
self.add_cmd_output([
122132
"find /var/lib/lxd -maxdepth 2 -type d -ls",
123133
], suggest_filename='var-lxd-dirs.txt')
124134

135+
self.add_cmd_output(lxc_cmds, pred=lxd_pred, snap_cmd=self.is_snap)
136+
125137
def postproc(self):
126138
self.do_cmd_private_sub('lxd.buginfo')
127139

0 commit comments

Comments
 (0)