Update code with feedback from code review:
1. Rebase 2. Update the new mitaka/nova.conf template 3. Add related_unit call to get the units
This commit is contained in:
parent
b492f1a79e
commit
8808bf9302
@ -269,7 +269,8 @@ def config_changed():
|
||||
# to ensure the value is propagated to the compute nodes.
|
||||
if config_value_changed('region'):
|
||||
for rid in relation_ids('cloud-compute'):
|
||||
compute_changed(rid)
|
||||
for unit in related_units(rid):
|
||||
compute_changed(rid, unit)
|
||||
|
||||
update_nova_consoleauth_config()
|
||||
|
||||
|
@ -157,6 +157,8 @@ auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}
|
||||
region = {{ region }}
|
||||
{% endif -%}
|
||||
|
||||
{% include "parts/cinder" %}
|
||||
|
||||
[osapi_v3]
|
||||
enabled=True
|
||||
|
||||
|
@ -45,6 +45,7 @@ TO_PATCH = [
|
||||
'local_unit',
|
||||
'log',
|
||||
'os_release',
|
||||
'related_units',
|
||||
'relation_get',
|
||||
'relation_set',
|
||||
'relation_ids',
|
||||
@ -211,10 +212,11 @@ class NovaCCHooksTests(CharmTestCase):
|
||||
self.git_install_requested.return_value = False
|
||||
self.openstack_upgrade_available.return_value = False
|
||||
self.config_value_changed.return_value = True
|
||||
self.related_units.return_value = ['unit/0']
|
||||
self.relation_ids.side_effect = \
|
||||
lambda x: ['generic_rid'] if x == 'cloud-compute' else []
|
||||
hooks.config_changed()
|
||||
mock_compute_changed.assert_has_calls([call('generic_rid')])
|
||||
mock_compute_changed.assert_has_calls([call('generic_rid', 'unit/0')])
|
||||
|
||||
def test_compute_changed_ssh_migration(self):
|
||||
self.test_relation.set({
|
||||
|
Loading…
x
Reference in New Issue
Block a user