aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Desrochers <eric.desrochers@canonical.com>2020-04-11 14:50:44 -0400
committerJake Hunsaker <jhunsake@redhat.com>2020-04-14 13:47:21 -0400
commit770ac54c2305cb26167229264fcdd5ef273a3bea (patch)
tree6b7186fdf65604f1f3b5923318aacc65d3dd9750
parent89dcfaa6de0310c54a988d1eb5a4a5dc10e3fef4 (diff)
downloadsos-770ac54c2305cb26167229264fcdd5ef273a3bea.tar.gz
[landscape] simplify and remove deprecated log dir
* Make add_copy_spec & add_cmd_output method to accept a list. * Log directory "/var/log/landscape-server" is now fully deprecated. Nowadays, all supported versions are logging inside "/var/log/landscape". Resolves: #2012 Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/landscape.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/sos/report/plugins/landscape.py b/sos/report/plugins/landscape.py
index 36755282..e5574f77 100644
--- a/sos/report/plugins/landscape.py
+++ b/sos/report/plugins/landscape.py
@@ -19,21 +19,25 @@ class Landscape(Plugin, UbuntuPlugin):
packages = ('landscape-client', 'landscape-server')
def setup(self):
- self.add_copy_spec("/etc/landscape/client.conf")
- self.add_copy_spec("/etc/default/landscape-client")
- self.add_copy_spec("/etc/landscape/service.conf")
- self.add_copy_spec("/etc/landscape/service.conf.old")
- self.add_copy_spec("/etc/default/landscape-server")
- self.add_copy_spec("/var/lib/landscape/landscape-oops/*/OOPS-*")
+ self.add_copy_spec([
+ "/etc/default/landscape-client",
+ "/etc/default/landscape-server",
+ "/etc/landscape/client.conf",
+ "/etc/landscape/service.conf",
+ "/etc/landscape/service.conf.old",
+ "/var/lib/landscape/landscape-oops/*/OOPS-*"
+ ])
+
if not self.get_option("all_logs"):
self.add_copy_spec("/var/log/landscape/*.log")
- self.add_copy_spec("/var/log/landscape-server/*.log")
else:
self.add_copy_spec("/var/log/landscape")
- self.add_copy_spec("/var/log/landscape-server")
- self.add_cmd_output("gpg --verify /etc/landscape/license.txt")
- self.add_cmd_output("head -n 5 /etc/landscape/license.txt")
- self.add_cmd_output("lsctl status")
+
+ self.add_cmd_output([
+ "gpg --verify /etc/landscape/license.txt",
+ "head -n 5 /etc/landscape/license.txt",
+ "lsctl status"
+ ])
def postproc(self):
self.do_file_sub(