Skip to content

Commit

Permalink
move new check into get_placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
FxKu committed Sep 23, 2024
1 parent ead6e0d commit 95f2742
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions postgres-appliance/scripts/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ def get_placeholders(provider):
placeholders.setdefault('LOG_TMPDIR', os.path.abspath(os.path.join(placeholders['PGROOT'], '../tmp')))
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']

# see comment for wal-e bucket prefix
placeholders.setdefault('LOG_BUCKET_SCOPE_PREFIX', '{0}-'.format(placeholders['NAMESPACE'])
if placeholders['NAMESPACE'] not in ('default', '') else '')
Expand Down Expand Up @@ -1083,9 +1087,6 @@ def main():
placeholders = get_placeholders(provider)
logging.info('Looks like you are running %s', provider)

# only accept true as value or else it will be empty = disabled
placeholders['LOG_SHIP_HOURLY'] = os.environ.get('LOG_SHIP_HOURLY', '') in ['true', 'TRUE']

config = yaml.safe_load(pystache_render(TEMPLATE, placeholders))
config.update(get_dcs_config(config, placeholders))

Expand Down

0 comments on commit 95f2742

Please sign in to comment.