fixes
This commit is contained in:
parent
05bd411320
commit
53ee4bc20b
|
@ -20,6 +20,7 @@ from charmhelpers.core.hookenv import (
|
|||
config,
|
||||
charm_dir,
|
||||
log,
|
||||
relation_ids,
|
||||
relation_set,
|
||||
open_port,
|
||||
unit_get
|
||||
|
@ -50,7 +51,6 @@ from heat_utils import (
|
|||
determine_packages,
|
||||
register_configs,
|
||||
HEAT_CONF,
|
||||
HEAT_API_PASTE,
|
||||
)
|
||||
|
||||
from heat_context import (
|
||||
|
@ -87,6 +87,7 @@ def config_changed():
|
|||
if openstack_upgrade_available('heat-engine'):
|
||||
do_openstack_upgrade(CONFIGS)
|
||||
CONFIGS.write_all()
|
||||
configure_https()
|
||||
|
||||
|
||||
@hooks.hook('amqp-relation-joined')
|
||||
|
@ -137,6 +138,9 @@ def configure_https():
|
|||
# first then checking reload status (see LP #1433114).
|
||||
service_reload('apache2', restart_on_failure=True)
|
||||
|
||||
for rid in relation_ids('identity-service'):
|
||||
identity_joined(rid=rid)
|
||||
|
||||
|
||||
@hooks.hook('identity-service-relation-joined')
|
||||
def identity_joined(rid=None):
|
||||
|
@ -165,8 +169,9 @@ def identity_changed():
|
|||
if 'identity-service' not in CONFIGS.complete_contexts():
|
||||
log('identity-service relation incomplete. Peer not ready?')
|
||||
return
|
||||
CONFIGS.write(HEAT_API_PASTE)
|
||||
CONFIGS.write(HEAT_CONF)
|
||||
|
||||
CONFIGS.write_all()
|
||||
configure_https()
|
||||
|
||||
|
||||
@hooks.hook('amqp-relation-broken',
|
||||
|
|
|
@ -66,11 +66,13 @@ class HeatRelationTests(CharmTestCase):
|
|||
'heat-engine'], fatal=True)
|
||||
self.execd_preinstall.assert_called()
|
||||
|
||||
def test_config_changed_no_upgrade(self):
|
||||
@patch.object(relations, 'configure_https')
|
||||
def test_config_changed_no_upgrade(self, mock_configure_https):
|
||||
self.openstack_upgrade_available.return_value = False
|
||||
relations.config_changed()
|
||||
|
||||
def test_config_changed_with_upgrade(self):
|
||||
@patch.object(relations, 'configure_https')
|
||||
def test_config_changed_with_upgrade(self, mock_configure_https):
|
||||
self.openstack_upgrade_available.return_value = True
|
||||
relations.config_changed()
|
||||
self.assertTrue(self.do_openstack_upgrade.called)
|
||||
|
@ -177,11 +179,12 @@ class HeatRelationTests(CharmTestCase):
|
|||
}
|
||||
self.relation_set.assert_called_with(**ex)
|
||||
|
||||
@patch.object(relations, 'configure_https')
|
||||
@patch.object(relations, 'CONFIGS')
|
||||
def test_identity_changed(self, configs):
|
||||
def test_identity_changed(self, configs, mock_configure_https):
|
||||
configs.complete_contexts.return_value = ['identity-service']
|
||||
relations.identity_changed()
|
||||
self.assertTrue(configs.write.called)
|
||||
self.assertTrue(configs.write_all.called)
|
||||
|
||||
@patch.object(relations, 'CONFIGS')
|
||||
def test_identity_changed_incomplete(self, configs):
|
||||
|
|
Loading…
Reference in New Issue