diff options
author | Periyasamy Palanisamy <pepalani@redhat.com> | 2023-08-15 11:47:20 +0200 |
---|---|---|
committer | Jake Hunsaker <jacob.r.hunsaker@gmail.com> | 2023-08-21 23:09:49 -0400 |
commit | e11a594f942f9ae98aeb644c573293b391050657 (patch) | |
tree | c1b1fa2a342a67d06557b62f0486acea6ac8d12a | |
parent | 43714aa5aeb3dcb0dec17dd026ca5c394cc06afd (diff) | |
download | sos-e11a594f942f9ae98aeb644c573293b391050657.tar.gz |
Collect ovn logs as much as possible
The sosreport limits to collect logs at maximum of 25 MB in a given
collection passed into add_copy_spec method. so this may lead into
logs wouldn't have fully collected when user collected sos report
without --all-logs option.
Hence this commit ensures logs and dbs collected as much as possible
when --all-logs option is not specified.
Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
-rw-r--r-- | sos/report/plugins/openshift_ovn.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sos/report/plugins/openshift_ovn.py b/sos/report/plugins/openshift_ovn.py index 2d804e9a..347b15ee 100644 --- a/sos/report/plugins/openshift_ovn.py +++ b/sos/report/plugins/openshift_ovn.py @@ -20,19 +20,28 @@ class OpenshiftOVN(Plugin, RedHatPlugin): profiles = ('openshift',) def setup(self): + all_logs = self.get_option("all_logs") + self.add_copy_spec([ "/var/lib/ovn/etc/ovnnb_db.db", "/var/lib/ovn/etc/ovnsb_db.db", - "/var/lib/openvswitch/etc/keys", - "/var/log/openvswitch/libreswan.log", - "/var/log/openvswitch/ovs-monitor-ipsec.log" - ]) - # Collect ovn interconnect specific files if exists. + "/var/lib/openvswitch/etc/keys" + ], sizelimit=300) + + # Collect ovn interconnect specific db files if exists. self.add_copy_spec([ "/var/lib/ovn-ic/etc/ovnnb_db.db", - "/var/lib/ovn-ic/etc/ovnsb_db.db", - "/var/lib/ovn-ic/etc/libovsdb*log*" - ]) + "/var/lib/ovn-ic/etc/ovnsb_db.db" + ], sizelimit=300) + + # Collect libovsdb logs in case of ovn interconnect setup. + if not all_logs: + self.add_copy_spec([ + "/var/lib/ovn-ic/etc/libovsdb.log", + "/var/lib/ovn-ic/etc/libovsdb*log.gz" + ], sizelimit=100) + else: + self.add_copy_spec("/var/lib/ovn-ic/etc/libovsdb*log*") # The ovn cluster/status is not valid anymore for interconnect setup. self.add_cmd_output([ |