From 3859f6464ab0ab6b418c2d39561196a848e28df5 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 14 May 2021 08:56:42 -0400 Subject: [PATCH 1/3] dont be quiet on first grep --- setup/so-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/so-setup b/setup/so-setup index 4573da330..4c364ded6 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -926,7 +926,7 @@ if [[ $success != 0 ]]; then SO_ERROR=1; fi # Check entire setup log for errors or unexpected salt states and ensure cron jobs are not reporting errors to root's mailbox # Ignore "Status .* was not found" due to output from salt http.query or http.wait_for_successful_query states used with retry -if grep -q -E "ERROR|Result: False" $setup_log | grep -qvE "Status .* was not found" || [[ -s /var/spool/mail/root && "$setup_type" == "iso" ]]; then +if grep -E "ERROR|Result: False" $setup_log | grep -qvE "Status .* was not found" || [[ -s /var/spool/mail/root && "$setup_type" == "iso" ]]; then SO_ERROR=1 grep --color=never "ERROR" "$setup_log" | grep -qvE "Status .* was not found" > "$error_log" From 231e07dbbda9a33091be927c70965ddcab26cec7 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 14 May 2021 15:19:45 -0400 Subject: [PATCH 2/3] circumvent file.patch putting ERROR in log if patch doesnt need applied --- salt/salt/python3-influxdb.sls | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/salt/salt/python3-influxdb.sls b/salt/salt/python3-influxdb.sls index acadf2161..055390a27 100644 --- a/salt/salt/python3-influxdb.sls +++ b/salt/salt/python3-influxdb.sls @@ -15,6 +15,9 @@ python3_influxdb: {{PYTHONINSTALLER}}.installed: - name: {{ PYTHON3INFLUX }} +# We circumvent the file.patch state putting ERROR in the log by using the unless and file.touch below +# https://github.com/saltstack/salt/pull/47010 and https://github.com/saltstack/salt/issues/52329 + #https://github.com/saltstack/salt/issues/59766 influxdb_continuous_query.present_patch: file.patch: @@ -23,8 +26,15 @@ influxdb_continuous_query.present_patch: - require: - {{PYTHONINSTALLER}}: python3_influxdb - pkg: patch_package + - unless: ls /opt/so/state/influxdb_continuous_query.py.patched -#https://github.com/saltstack/salt/issues/59761 +influxdb_continuous_query.py.patched: + file.touch: + - name: /opt/so/state/influxdb_continuous_query.py.patched + - onchanges: + - file: influxdb_continuous_query.present_patch + + #https://github.com/saltstack/salt/issues/59761 influxdb_retention_policy.present_patch: file.patch: - name: {{ SALT_STATE_CODE_PATH }}/influxdb_retention_policy.py @@ -32,6 +42,13 @@ influxdb_retention_policy.present_patch: - require: - {{PYTHONINSTALLER}}: python3_influxdb - pkg: patch_package + - unless: ls /opt/so/state/influxdb_retention_policy.py.patched + +influxdb_retention_policy.py.patched: + file.touch: + - name: /opt/so/state/influxdb_retention_policy.py.patched + - onchanges: + - file: influxdb_retention_policy.present_patch # We should be able to set reload_modules: True in this state in order to tell salt to reload its python modules due to us possibly installing # and possibly modifying modules in this state. This is bugged according to https://github.com/saltstack/salt/issues/24925 @@ -41,4 +58,13 @@ influxdbmod.py_shard_duration_patch: - source: salt://salt/files/influxdbmod.py.patch - require: - {{PYTHONINSTALLER}}: python3_influxdb - - pkg: patch_package \ No newline at end of file + - pkg: patch_package + - unless: ls /opt/so/state/influxdbmod.py.patched + +influxdbmod.py.patched: + file.touch: + - name: /opt/so/state/influxdbmod.py.patched + - onchanges: + - file: influxdbmod.py_shard_duration_patch + + From 54f9e3ff9df127d1ddd2706db5109f414dc4bd4c Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 14 May 2021 16:24:16 -0400 Subject: [PATCH 3/3] remove leading space on comment line --- salt/salt/python3-influxdb.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/salt/python3-influxdb.sls b/salt/salt/python3-influxdb.sls index 055390a27..7a59c4303 100644 --- a/salt/salt/python3-influxdb.sls +++ b/salt/salt/python3-influxdb.sls @@ -34,7 +34,7 @@ influxdb_continuous_query.py.patched: - onchanges: - file: influxdb_continuous_query.present_patch - #https://github.com/saltstack/salt/issues/59761 +#https://github.com/saltstack/salt/issues/59761 influxdb_retention_policy.present_patch: file.patch: - name: {{ SALT_STATE_CODE_PATH }}/influxdb_retention_policy.py