From 9e78b9e07bbce399b12e0095fe593badd22978a2 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 28 Apr 2024 21:40:35 +0200 Subject: [PATCH] python3.12 compat --- bundles/nginx/metadata.py | 4 ++-- bundles/rspamd/items.py | 2 +- nodes/home/nas.py | 4 ++-- nodes/home/router.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bundles/nginx/metadata.py b/bundles/nginx/metadata.py index e52bc11..2715065 100644 --- a/bundles/nginx/metadata.py +++ b/bundles/nginx/metadata.py @@ -200,8 +200,8 @@ def telegraf_anon_timing(metadata): result[f'nginx-{vname}'] = { 'files': [f'/var/log/nginx-timing/{vname}.log'], 'from_beginning': False, - 'grok_patterns': ['%{LOGPATTERN}'], - 'grok_custom_patterns': 'LOGPATTERN \[%{HTTPDATE:ts:ts-httpd}\] %{NUMBER:request_time:float} (?:%{NUMBER:upstream_response_time:float}|-) "%{WORD:verb:tag} %{NOTSPACE:request} HTTP/%{NUMBER:http_version:float}" %{NUMBER:resp_code:tag}', + 'grok_patterns': [r'%{LOGPATTERN}'], + 'grok_custom_patterns': r'LOGPATTERN \[%{HTTPDATE:ts:ts-httpd}\] %{NUMBER:request_time:float} (?:%{NUMBER:upstream_response_time:float}|-) "%{WORD:verb:tag} %{NOTSPACE:request} HTTP/%{NUMBER:http_version:float}" %{NUMBER:resp_code:tag}', 'data_format': 'grok', 'name_override': 'nginx_timing', } diff --git a/bundles/rspamd/items.py b/bundles/rspamd/items.py index 8fa793c..0491d17 100644 --- a/bundles/rspamd/items.py +++ b/bundles/rspamd/items.py @@ -101,7 +101,7 @@ if 'dkim' in node.metadata.get('rspamd', {}): actions = { 'rspamd_assure_dkim_key_permissions': { 'command': 'chown _rspamd:_rspamd /var/lib/rspamd/dkim/*.key', - 'unless': 'test -z "$(find /var/lib/rspamd/ -iname \"*.key\" \! -user _rspamd)"', + 'unless': r'test -z "$(find /var/lib/rspamd/ -iname \"*.key\" \! -user _rspamd)"', 'needs': { 'action:rspamd_generate_dkim_key', 'directory:/var/lib/rspamd/dkim', diff --git a/nodes/home/nas.py b/nodes/home/nas.py index 20e2679..695941e 100644 --- a/nodes/home/nas.py +++ b/nodes/home/nas.py @@ -212,8 +212,8 @@ nodes['home.nas'] = { 'nas_permissions': { 'command': [ 'chown -R :nas /storage/nas/', - 'find /storage/nas/ -type d -exec chmod 0775 {} \;', - 'find /storage/nas/ -type f -exec chmod 0664 {} \;', + r'find /storage/nas/ -type d -exec chmod 0775 {} \;', + r'find /storage/nas/ -type f -exec chmod 0664 {} \;', ], 'when': '*-*-* 02:00:00', }, diff --git a/nodes/home/router.py b/nodes/home/router.py index 67845ba..968477a 100644 --- a/nodes/home/router.py +++ b/nodes/home/router.py @@ -45,7 +45,7 @@ nodes['home.router'] = { # connected longer than 24 hours. We install this cronjob # to make sure we don't get disconnected randomly during the # day. - 'restart_pppd': '23 2 * * * root systemctl restart pppoe && date -u +\%s > /var/tmp/pppd-last-restart.status', + 'restart_pppd': r'23 2 * * * root systemctl restart pppoe && date -u +\%s > /var/tmp/pppd-last-restart.status', }, }, 'kea-dhcp-server': {