From 1fd4c20f5d7531bffb8ab6ce8653697a2f1e841a Mon Sep 17 00:00:00 2001 From: James Page Date: Fri, 8 Jul 2016 17:46:58 +0100 Subject: [PATCH] Use correct relation key for restarts The nova-cloud-controller charm set the relation key 'restart_trigger'; this charm was using 'restart_nonce' which obviously never gets set, so the nova-api-metadata service would never actually get restarted when required. Use the correct relation key, fixing remote restart triggers for nova-api-metadata, resolving races in deployment. Change-Id: Ic3dbdd41f87c0362f7f725d0f58458f5239ea093 Closes-Bug: 1547122 --- hooks/neutron_hooks.py | 2 +- unit_tests/test_neutron_hooks.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hooks/neutron_hooks.py b/hooks/neutron_hooks.py index b38871e9..f9d1acc1 100755 --- a/hooks/neutron_hooks.py +++ b/hooks/neutron_hooks.py @@ -226,7 +226,7 @@ def nm_changed(): # NOTE: nova-api-metadata needs to be restarted # once the nova-conductor is up and running # on the nova-cc units. - restart_nonce = relation_get('restart_nonce') + restart_nonce = relation_get('restart_trigger') if restart_nonce is not None: db = kv() previous_nonce = db.get('restart_nonce', diff --git a/unit_tests/test_neutron_hooks.py b/unit_tests/test_neutron_hooks.py index a1bee60b..d46224a3 100644 --- a/unit_tests/test_neutron_hooks.py +++ b/unit_tests/test_neutron_hooks.py @@ -295,7 +295,7 @@ class TestQuantumHooks(CharmTestCase): def _relation_get(key): data = { 'ca_cert': 'cert', - 'restart_nonce': '1111111222222333333', + 'restart_trigger': '1111111222222333333', } return data.get(key) self.relation_get.side_effect = _relation_get @@ -317,7 +317,7 @@ class TestQuantumHooks(CharmTestCase): def _relation_get(key): data = { 'ca_cert': 'cert', - 'restart_nonce': '1111111222222333333', + 'restart_trigger': '1111111222222333333', } return data.get(key) self.relation_get.side_effect = _relation_get