Skip to content

Commit

Permalink
Collect ovn logs as much as possible
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pperiyasamy authored and TurboTurtle committed Aug 22, 2023
1 parent 43714aa commit e11a594
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions sos/report/plugins/openshift_ovn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down

0 comments on commit e11a594

Please sign in to comment.