Merge lp:~verterok/charms/trusty/haproxy/fix-rsyslog-restart-on-pkg-upgrade into lp:~tanuki/charms/trusty/haproxy/trunk

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 104
Merged at revision: 102
Proposed branch: lp:~verterok/charms/trusty/haproxy/fix-rsyslog-restart-on-pkg-upgrade
Merge into: lp:~tanuki/charms/trusty/haproxy/trunk
Diff against target: 28 lines (+6/-6)
1 file modified
hooks/hooks.py (+6/-6)
To merge this branch: bzr merge lp:~verterok/charms/trusty/haproxy/fix-rsyslog-restart-on-pkg-upgrade
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Review via email: mp+272179@code.launchpad.net

Commit message

Fix if/else ordering in config check (bug introduced in the last changes)

Description of the change

Fix if/else ordering in config check (bug introduced in the last changes)

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2015-09-22 21:10:38 +0000
+++ hooks/hooks.py 2015-09-23 21:14:40 +0000
@@ -957,18 +957,18 @@
957 if not (get_listen_stanzas() == old_stanzas):957 if not (get_listen_stanzas() == old_stanzas):
958 notify_website()958 notify_website()
959 notify_peer()959 notify_peer()
960 else:
961 # XXX Ideally the config should be restored to a working state if the
962 # check fails, otherwise an inadvertent reload will cause the service
963 # to be broken.
964 log("HAProxy configuration check failed, exiting.")
965 sys.exit(1)
960 if config_data.changed("global_log") or config_data.changed("source"):966 if config_data.changed("global_log") or config_data.changed("source"):
961 # restart rsyslog to pickup haproxy rsyslog config967 # restart rsyslog to pickup haproxy rsyslog config
962 # This could be removed once the following bug is fixed in the haproxy968 # This could be removed once the following bug is fixed in the haproxy
963 # package:969 # package:
964 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790871970 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790871
965 service_restart("rsyslog")971 service_restart("rsyslog")
966 else:
967 # XXX Ideally the config should be restored to a working state if the
968 # check fails, otherwise an inadvertent reload will cause the service
969 # to be broken.
970 log("HAProxy configuration check failed, exiting.")
971 sys.exit(1)
972972
973973
974def start_hook():974def start_hook():

Subscribers

People subscribed via source and target branches