From a321f35a30ba5db6cfe2e7f27d71ee953cebe701 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Wed, 9 Oct 2024 17:02:25 +0200 Subject: [PATCH] Fix wrong bool handling of LOG_SHIP_HOURLY (#1030) * ensure LOG_SHIP_HOURLY env var remains a string * only allow true or empty for LOG_SHIP_HOURLY variable Co-authored-by: Polina Bungina <27892524+hughcapet@users.noreply.github.com> --------- Co-authored-by: Polina Bungina <27892524+hughcapet@users.noreply.github.com> --- postgres-appliance/scripts/configure_spilo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/postgres-appliance/scripts/configure_spilo.py b/postgres-appliance/scripts/configure_spilo.py index 970ba7b7..54907075 100755 --- a/postgres-appliance/scripts/configure_spilo.py +++ b/postgres-appliance/scripts/configure_spilo.py @@ -599,8 +599,10 @@ def get_placeholders(provider): placeholders.setdefault('LOG_BUCKET_SCOPE_SUFFIX', '') # only accept true as value or else it will be empty = disabled - if placeholders['LOG_SHIP_HOURLY']: - placeholders['LOG_SHIP_HOURLY'] = os.environ.get('LOG_SHIP_HOURLY', '') in ['true', 'TRUE'] + if placeholders.get('LOG_SHIP_HOURLY', '').lower() == 'true': + placeholders['LOG_SHIP_HOURLY'] = 'true' + else: + placeholders['LOG_SHIP_HOURLY'] = '' # see comment for wal-e bucket prefix placeholders.setdefault('LOG_BUCKET_SCOPE_PREFIX', '{0}-'.format(placeholders['NAMESPACE'])