aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Michelson <mmichels@redhat.com>2018-05-17 16:43:58 -0400
committerBryn M. Reeves <bmr@redhat.com>2018-05-21 16:13:28 +0100
commit10bb3b2d6f6817bb4ae96ba58865bff294e54f8d (patch)
treee3d637883408392dac34bd23983c0ace79500ea2
parentcf676ebdbe91a6a5736e2f052e932a935d9ca381 (diff)
downloadsos-10bb3b2d6f6817bb4ae96ba58865bff294e54f8d.tar.gz
[openvswitch] Add additional logging paths.
Openvswitch's logs can be located in alternate paths depending on the installation. OpenStack installations, for instance, do not use the same directories for logs as typical package installations. Related: #1259 Signed-off-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/openvswitch.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py
index 6f1b41ac..ab908fbc 100644
--- a/sos/plugins/openvswitch.py
+++ b/sos/plugins/openvswitch.py
@@ -16,6 +16,9 @@
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+from os.path import join as path_join
+from os import environ
+
class OpenVSwitch(Plugin):
""" OpenVSwitch networking
@@ -28,12 +31,22 @@ class OpenVSwitch(Plugin):
all_logs = self.get_option("all_logs")
limit = self.get_option("log_size")
+ log_dirs = [
+ '/var/log/containers/openvswitch/',
+ '/var/log/openvswitch/',
+ '/usr/local/var/log/openvswitch/',
+ ]
+
+ if environ.get('OVS_LOGDIR'):
+ log_dirs.append(environ.get('OVS_LOGDIR'))
+
if not all_logs:
- self.add_copy_spec("/var/log/openvswitch/*.log",
+ self.add_copy_spec([path_join(ld, '*.log') for ld in log_dirs],
sizelimit=limit)
- else:
- self.add_copy_spec("/var/log/openvswitch/",
+ self.add_copy_spec([path_join(ld, '*.log') for ld in log_dirs],
sizelimit=limit)
+ else:
+ self.add_copy_spec(log_dirs, sizelimit=limit)
self.add_copy_spec([
"/var/run/openvswitch/ovsdb-server.pid",