aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-04-06 13:57:06 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-04-15 11:33:04 -0400
commitcf2e094aa252bb643859c05ad6823832ac36afbe (patch)
tree3df5b905680b230082e5bb04ed3d9603ea41876e
parent242c4b7f3ba5c25d08b9805a1ff5a62208dcf775 (diff)
downloadsos-cf2e094aa252bb643859c05ad6823832ac36afbe.tar.gz
[libreswan] Add predicate for xfrm commands
Adds a predicate to gate collection of `ip xfrm` commands, dependent on if the `xfrm_algo` and `xfrm_user` kmods are already loaded. Discovered during testing for #2431 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/libreswan.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/sos/report/plugins/libreswan.py b/sos/report/plugins/libreswan.py
index 3362494d..cf815bde 100644
--- a/sos/report/plugins/libreswan.py
+++ b/sos/report/plugins/libreswan.py
@@ -9,7 +9,7 @@
#
# See the LICENSE file in the source distribution for further information.
-from sos.report.plugins import Plugin, IndependentPlugin
+from sos.report.plugins import Plugin, IndependentPlugin, SoSPredicate
class Libreswan(Plugin, IndependentPlugin):
@@ -39,10 +39,16 @@ class Libreswan(Plugin, IndependentPlugin):
'ipsec verify',
'ipsec whack --status',
'ipsec whack --listall',
- 'certutil -L -d sql:/etc/ipsec.d',
+ 'certutil -L -d sql:/etc/ipsec.d'
+ ])
+
+ # may load xfrm kmods
+ xfrm_pred = SoSPredicate(self, kmods=['xfrm_user', 'xfrm_algo'],
+ required={'kmods': 'all'})
+ self.add_cmd_output([
'ip xfrm policy',
'ip xfrm state'
- ])
+ ], pred=xfrm_pred)
if self.get_option("ipsec-barf"):
self.add_cmd_output("ipsec barf")