Skip to content

Commit

Permalink
Fix wrong bool handling of LOG_SHIP_HOURLY (#1030)
Browse files Browse the repository at this point in the history
* ensure LOG_SHIP_HOURLY env var remains a string
* only allow true or empty for LOG_SHIP_HOURLY variable

Co-authored-by: Polina Bungina <[email protected]>

---------

Co-authored-by: Polina Bungina <[email protected]>
  • Loading branch information
FxKu and hughcapet authored Oct 9, 2024
1 parent 618f7af commit a321f35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions postgres-appliance/scripts/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit a321f35

Please sign in to comment.