aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2021-01-08 09:25:54 +0100
committerJake Hunsaker <jhunsake@redhat.com>2021-01-13 13:13:02 -0500
commit164b28f60030a91c0bc99cb36b668efc7edfcf22 (patch)
tree6880be3daa7fca80a5f1895714a747a33b0b6033
parent0f74186752d85d80006187261e9bdb8b104a05fe (diff)
downloadsos-164b28f60030a91c0bc99cb36b668efc7edfcf22.tar.gz
[sapnw] call sapconf only when a limits.d file exists
sapconf command creates /etc/security/limits.d/99-sap-limits.conf on its own when missing, so calling the command must be gated by a predicate testing the file presence. Resolves: #2361 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/sapnw.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sos/report/plugins/sapnw.py b/sos/report/plugins/sapnw.py
index e32afcdd..00984d5b 100644
--- a/sos/report/plugins/sapnw.py
+++ b/sos/report/plugins/sapnw.py
@@ -129,6 +129,12 @@ class sapnw(Plugin, RedHatPlugin):
self.collect_list_dbs()
# run sapconf in check mode
- self.add_cmd_output("sapconf -n", suggest_filename="sapconf_checkmode")
+ #
+ # since the command creates a limits.d file on its own,
+ # we must predicate it by presence of the file
+ if os.path.exists('/etc/security/limits.d/99-sap-limits.conf') \
+ or self.get_option('allow_system_changes'):
+ self.add_cmd_output("sapconf -n",
+ suggest_filename="sapconf_checkmode")
# vim: et ts=4 sw=4