Inform Neutron gateway if certs change

As with nova-compute the neutron-gateway needs to know if the CA
changes otherwise certificate validation will fail when it makes
calls out to other endpoints.

Change-Id: I45beef2521e8168d98482709a4d0196b6859db5c
This commit is contained in:
Liam Young 2019-05-14 11:04:21 +00:00
parent 822daf2794
commit 65b30f2282
2 changed files with 9 additions and 3 deletions

View File

@ -1011,6 +1011,8 @@ def certs_changed(relation_id=None, unit=None):
configure_https()
for rid in hookenv.relation_ids('cloud-compute'):
compute_joined(rid=rid, remote_restart=False)
for rid in hookenv.relation_ids('quantum-network-service'):
quantum_joined(rid=rid, remote_restart=False)
@hooks.hook('amqp-cell-relation-joined')

View File

@ -984,17 +984,21 @@ class NovaCCHooksTests(CharmTestCase):
hooks.memcached_joined()
@patch.object(utils, 'resource_map')
@patch.object(hooks, 'quantum_joined')
@patch.object(hooks, 'compute_joined')
@patch.object(hooks, 'configure_https')
@patch.object(hooks.cert_utils, 'process_certificates')
def test_certs_changed(self, process_certificates, configure_https,
compute_joined, resource_map):
compute_joined, quantum_joined, resource_map):
resource_map.return_value = {}
self.os_release.return_value = 'rocky'
self.relation_ids.return_value = ['relid']
relids = [['relid2'], ['relid1']]
self.relation_ids.side_effect = lambda x: relids.pop()
hooks.certs_changed()
process_certificates.assert_called_once_with('nova', None, None,
group='nova')
configure_https.assert_called_once_with()
compute_joined.assert_called_once_with(remote_restart=False,
rid='relid')
rid='relid1')
quantum_joined.assert_called_once_with(remote_restart=False,
rid='relid2')