diff -Nru sosreport-3.9/debian/changelog sosreport-3.9/debian/changelog --- sosreport-3.9/debian/changelog 2020-02-20 12:53:25.000000000 -0800 +++ sosreport-3.9/debian/changelog 2020-03-24 19:40:21.000000000 -0700 @@ -1,3 +1,10 @@ +sosreport (3.9-1ubuntu0.18.04.2) bionic; urgency=medium + + * Drop db collection and introduce lxd.buginfo (LP: #1868215) + - d/p/0001-lxd-Drop-db-collection-and-introduce-lxd.buginfo.patch + + -- Seyeong Kim Tue, 24 Mar 2020 19:40:21 -0700 + sosreport (3.9-1ubuntu0.18.04.1) bionic; urgency=medium * New 3.9 upstream release (LP: #1862830) diff -Nru sosreport-3.9/debian/patches/0001-lxd-Drop-db-collection-and-introduce-lxd.buginfo.patch sosreport-3.9/debian/patches/0001-lxd-Drop-db-collection-and-introduce-lxd.buginfo.patch --- sosreport-3.9/debian/patches/0001-lxd-Drop-db-collection-and-introduce-lxd.buginfo.patch 1969-12-31 16:00:00.000000000 -0800 +++ sosreport-3.9/debian/patches/0001-lxd-Drop-db-collection-and-introduce-lxd.buginfo.patch 2020-03-24 19:40:07.000000000 -0700 @@ -0,0 +1,92 @@ +From f7469b2f316281c49e574467e41002f4b479b082 Mon Sep 17 00:00:00 2001 +From: Eric Desrochers +Date: Sun, 15 Mar 2020 13:54:39 -0400 +Subject: [PATCH] [lxd] Drop db collection and introduce lxd.buginfo +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 +Signed-off-by: Bryan Quigley +--- + sos/plugins/lxd.py | 44 ++++++++++++++++++-------------------------- + 1 file changed, 18 insertions(+), 26 deletions(-) + +Origin: upstream, https://github.com/sosreport/sos/pull/1982/commits/bdc5ffdf5b8376ab2014ec8fbd9a878cc9d0d264 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1868215 +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 : +-- +2.17.1 + diff -Nru sosreport-3.9/debian/patches/series sosreport-3.9/debian/patches/series --- sosreport-3.9/debian/patches/series 2020-02-15 17:35:52.000000000 -0800 +++ sosreport-3.9/debian/patches/series 2020-03-24 19:38:50.000000000 -0700 @@ -1 +1,2 @@ 0001-unittest-py3-fix.patch +0001-lxd-Drop-db-collection-and-introduce-lxd.buginfo.patch