Skip to content

Commit

Permalink
Skip supervisord ETCD config when ETCD_HOST/DISCOVERY_DOMAIN are defined
Browse files Browse the repository at this point in the history
Fixes #190
  • Loading branch information
joe-pll authored and CyberDem0n committed Nov 28, 2017
1 parent f928d20 commit bce46c4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions postgres-appliance/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,10 @@ def get_placeholders(provider):
def write_file(config, filename, overwrite):
if not overwrite and os.path.exists(filename):
logging.warning('File {} already exists, not overwriting. (Use option --force if necessary)'.format(filename))
with open(filename, 'w') as f:
logging.info('Writing to file {}'.format(filename))
f.write(config)
else:
with open(filename, 'w') as f:
logging.info('Writing to file {}'.format(filename))
f.write(config)


def pystache_render(*args, **kwargs):
Expand Down Expand Up @@ -523,7 +524,10 @@ def main():
placeholders = get_placeholders(provider)
logging.info('Looks like your running %s', provider)

if provider == PROVIDER_LOCAL and not USE_KUBERNETES:
if (provider == PROVIDER_LOCAL and
not USE_KUBERNETES and
'ETCD_HOST' not in placeholders and
'ETCD_DISCOVERY_DOMAIN' not in placeholders):
write_etcd_configuration(placeholders)

config = yaml.load(pystache_render(TEMPLATE, placeholders))
Expand Down

0 comments on commit bce46c4

Please sign in to comment.