~stub/charms/precise/postgresql/trunk-dev

« back to all changes in this revision

Viewing changes to hooks/hooks.py

[ahasenack] Include streaming_replication when writing out the recovery.conf file so that primary_conninfo gets added to it and replication can work. Per https://code.launchpad.net/~ahasenack/charms/precise/postgresql/postgresql-fix-recovery-conf/+merge/204576

Show diffs side-by-side

added added

removed removed

Lines of Context:
628
628
        old_recovery_conf = None
629
629
 
630
630
    charm_dir = hookenv.charm_dir()
 
631
    streaming_replication = hookenv.config('streaming_replication')
631
632
    template_file = "{}/templates/recovery.conf.tmpl".format(charm_dir)
632
633
    recovery_conf = Template(open(template_file).read()).render({
633
634
        'host': master_host,
634
 
        'password': local_state['replication_password']})
 
635
        'password': local_state['replication_password'],
 
636
        'streaming_replication': streaming_replication})
635
637
    log(recovery_conf, DEBUG)
636
638
    host.write_file(
637
639
        os.path.join(postgresql_cluster_dir, 'recovery.conf'),