Skip to content

Commit

Permalink
[networking] Update ss predicate for Ubuntu
Browse files Browse the repository at this point in the history
We see that the predicate is replicated among all Ubuntu distros after
22.04, so we simplify the check to ensure all distros are covered in the
future.

Signed-off-by: David Negreira <david.negreira@canonical.com>
  • Loading branch information
dnegreira authored and TurboTurtle committed May 22, 2024
1 parent ed04ba7 commit bbc42b5
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions sos/report/plugins/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,14 @@ class UbuntuNetworking(Networking, UbuntuPlugin, DebianPlugin):

def setup(self):

ubuntu_ss_kmods = dict.fromkeys([22.04, 23.10],
['tcp_diag', 'udp_diag',
'inet_diag', 'unix_diag',
'netlink_diag',
'af_packet_diag', 'xsk_diag',
'mptcp_diag', 'raw_diag'])

if self.policy.dist_version() in ubuntu_ss_kmods:
self.ss_kmods = ubuntu_ss_kmods[self.policy.dist_version()]
ubuntu_jammy_and_after_ss_kmods = ['tcp_diag', 'udp_diag',
'inet_diag', 'unix_diag',
'netlink_diag', 'af_packet_diag',
'xsk_diag', 'mptcp_diag',
'raw_diag']

if self.policy.dist_version() >= 22.04:
self.ss_kmods = ubuntu_jammy_and_after_ss_kmods

super().setup()

Expand Down

0 comments on commit bbc42b5

Please sign in to comment.