~ubuntuone-pqm-team/charm-haproxy/snap-store

« back to all changes in this revision

Viewing changes to hooks/hooks.py

[verterok, r=admcleod, a=kwmonroe] restart rsyslog if haproxy config changes; minor updates to tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
from itertools import izip, tee
15
15
from operator import itemgetter
16
16
 
17
 
from charmhelpers.core.host import pwgen, lsb_release
 
17
from charmhelpers.core.host import pwgen, lsb_release, service_restart
18
18
from charmhelpers.core.hookenv import (
19
19
    log,
20
20
    config as config_get,
963
963
        # to be broken.
964
964
        log("HAProxy configuration check failed, exiting.")
965
965
        sys.exit(1)
 
966
    if config_data.changed("global_log") or config_data.changed("source"):
 
967
        # restart rsyslog to pickup haproxy rsyslog config
 
968
        # This could be removed once the following bug is fixed in the haproxy
 
969
        # package:
 
970
        #   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790871
 
971
        service_restart("rsyslog")
966
972
 
967
973
 
968
974
def start_hook():