Merge lp:~johnsca/charms/trusty/haproxy/verterok-restart-rsyslog-after-install into lp:~verterok/charms/trusty/haproxy/restart-rsyslog-after-install

Proposed by Cory Johns
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 106
Merged at revision: 106
Proposed branch: lp:~johnsca/charms/trusty/haproxy/verterok-restart-rsyslog-after-install
Merge into: lp:~verterok/charms/trusty/haproxy/restart-rsyslog-after-install
Diff against target: 53 lines (+10/-7)
3 files modified
hooks/hooks.py (+6/-6)
hooks/tests/test_website_hooks.py (+0/-1)
tests/10_deploy_test.py (+4/-0)
To merge this branch: bzr merge lp:~johnsca/charms/trusty/haproxy/verterok-restart-rsyslog-after-install
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Review via email: mp+273867@code.launchpad.net

Description of the change

Fixed config-changed hook failure, test not catching aforementioned error, and minor lint issue.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

apologize for the delay.

Thanks for fixing this. I worked on a different approach, which is to move the "if config_data.changed("global_log")" outside the if/else.

Will land this and merge my fix later on.

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2015-09-22 21:10:38 +0000
3+++ hooks/hooks.py 2015-10-08 16:31:46 +0000
4@@ -957,12 +957,12 @@
5 if not (get_listen_stanzas() == old_stanzas):
6 notify_website()
7 notify_peer()
8- if config_data.changed("global_log") or config_data.changed("source"):
9- # restart rsyslog to pickup haproxy rsyslog config
10- # This could be removed once the following bug is fixed in the haproxy
11- # package:
12- # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790871
13- service_restart("rsyslog")
14+ if config_data.changed("global_log") or config_data.changed("source"):
15+ # restart rsyslog to pickup haproxy rsyslog config
16+ # This could be removed once the following bug is fixed in the
17+ # haproxy package:
18+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790871
19+ service_restart("rsyslog")
20 else:
21 # XXX Ideally the config should be restored to a working state if the
22 # check fails, otherwise an inadvertent reload will cause the service
23
24=== modified file 'hooks/tests/test_website_hooks.py'
25--- hooks/tests/test_website_hooks.py 2015-09-04 19:17:57 +0000
26+++ hooks/tests/test_website_hooks.py 2015-10-08 16:31:46 +0000
27@@ -147,4 +147,3 @@
28 all_services=""),
29 ])
30 self.log.assert_has_calls([call("No services configured, exiting.")])
31-
32
33=== modified file 'tests/10_deploy_test.py'
34--- tests/10_deploy_test.py 2015-03-18 20:28:29 +0000
35+++ tests/10_deploy_test.py 2015-10-08 16:31:46 +0000
36@@ -105,6 +105,8 @@
37 'crts': ['DEFAULT'],
38 'servers': [['apache', apache_private, 80, 'maxconn 50']]}])
39 })
40+time.sleep(10)
41+d.sentry.wait(seconds)
42
43 # We need a retry loop here, since there's no way to tell when the new
44 # configuration is in place.
45@@ -151,6 +153,8 @@
46 ['apache2', apache_private2, 80, 'maxconn 50']]}
47 ]}])
48 })
49+time.sleep(10)
50+d.sentry.wait(seconds)
51
52 # Let's exercise our URL-based routing by trying to fetch a URL that will
53 # only work for the second apache unit (which is configured as server

Subscribers

People subscribed via source and target branches

to all changes: