From 513afdde733ad17c5dd329c95d3f81fb42b20927 Mon Sep 17 00:00:00 2001 From: Juju Management User Date: Tue, 19 Nov 2013 15:00:25 +0000 Subject: [PATCH] Register stop hook and stop the L3 agent when its called --- hooks/quantum_hooks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hooks/quantum_hooks.py b/hooks/quantum_hooks.py index 8452d897..c8c7ce64 100755 --- a/hooks/quantum_hooks.py +++ b/hooks/quantum_hooks.py @@ -15,7 +15,8 @@ from charmhelpers.fetch import ( ) from charmhelpers.core.host import ( restart_on_change, - lsb_release + lsb_release, + service_stop ) from charmhelpers.contrib.hahelpers.cluster import( eligible_leader @@ -133,6 +134,11 @@ def cluster_departed(): CONFIGS.write_all() +@hooks.hook('stop') +def stop(): + service_stop('neutron-l3-agent') + + if __name__ == '__main__': try: hooks.execute(sys.argv)