sync only fatal=True in cluster relation

This commit is contained in:
Edward Hope-Morley 2015-01-12 17:02:08 +00:00
parent fa440c145c
commit 8ec5688fe4
2 changed files with 10 additions and 9 deletions

View File

@ -100,7 +100,7 @@ def install():
@hooks.hook('config-changed')
@restart_on_change(restart_map())
@synchronize_ca_if_changed(fatal=False)
@synchronize_ca_if_changed()
def config_changed():
if config('prefer-ipv6'):
setup_ipv6()
@ -286,13 +286,13 @@ def cluster_joined(relation_id=None):
relation_settings={'private-address': private_addr})
@synchronize_ca_if_changed()
@synchronize_ca_if_changed(fatal=True)
def identity_updates_with_ssl_sync():
CONFIGS.write_all()
update_all_identity_relation_units()
@synchronize_ca_if_changed(force=True)
@synchronize_ca_if_changed(force=True, fatal=True)
def identity_updates_with_forced_ssl_sync():
identity_updates_with_ssl_sync()
@ -416,7 +416,7 @@ def admin_relation_changed():
relation_set(**relation_data)
@synchronize_ca_if_changed()
@synchronize_ca_if_changed(fatal=True)
def configure_https():
'''
Enables SSL API Apache config if appropriate and kicks identity-service

View File

@ -721,7 +721,7 @@ def unison_sync(paths_to_sync):
fatal=True)
def synchronize_ca(fatal=True):
def synchronize_ca(fatal=False):
"""Broadcast service credentials to peers.
By default a failure to sync is fatal and will result in a raised
@ -792,7 +792,7 @@ def update_hash_from_path(hash, path, recurse_depth=10):
hash.update(fd.read())
def synchronize_ca_if_changed(force=False, fatal=True):
def synchronize_ca_if_changed(force=False, fatal=False):
"""Decorator to perform ssl cert sync if decorated function modifies them
in any way.
@ -836,6 +836,7 @@ def synchronize_ca_if_changed(force=False, fatal=True):
log("Doing forced ssl cert sync", level=DEBUG)
peer_settings = synchronize_ca(fatal=fatal)
if peer_settings:
for rid in relation_ids('cluster'):
relation_set(relation_id=rid,
relation_settings=peer_settings)