Rebase on trunk

This commit is contained in:
James Page 2013-11-08 13:41:39 +08:00
commit 3d5dbb5bda
5 changed files with 17 additions and 4 deletions

@ -19,7 +19,7 @@ options:
type: string
description: Username used to access rabbitmq queue
rabbit-vhost:
default: nova
default: openstack
type: string
decsription: Rabbitmq vhost
database-user:

@ -104,8 +104,9 @@ def config_changed():
@hooks.hook('amqp-relation-joined')
def amqp_joined():
relation_set(username=config('rabbit-user'), vhost=config('rabbit-vhost'))
def amqp_joined(relation_id=None):
relation_set(relation_id=relation_id,
username=config('rabbit-user'), vhost=config('rabbit-vhost'))
@hooks.hook('amqp-relation-changed')
@ -426,6 +427,12 @@ def nova_vmware_relation_changed():
CONFIGS.write('/etc/nova/nova.conf')
@hooks.hook('upgrade-charm')
def upgrade_charm():
for r_id in relation_ids('amqp'):
amqp_joined(relation_id=r_id)
def main():
try:
hooks.execute(sys.argv)

@ -60,6 +60,7 @@ FAKE_KS_AUTH_CFG = {
class NovaCCHooksTests(CharmTestCase):
def setUp(self):
super(NovaCCHooksTests, self).setUp(hooks, TO_PATCH)
self.config.side_effect = self.test_config.get
@ -135,4 +136,5 @@ class NovaCCHooksTests(CharmTestCase):
self.relation_set.assert_called_with(
network_manager='neutron', quantum_security_groups='no',
quantum_url='http://nova-cc-host1:9696', quantum_plugin='nvp',
relation_id=None,
**FAKE_KS_AUTH_CFG)

@ -112,6 +112,7 @@ def fake_plugin_attribute(plugin, attr, net_manager):
class NovaCCUtilsTests(CharmTestCase):
def setUp(self):
super(NovaCCUtilsTests, self).setUp(utils, TO_PATCH)
self.config.side_effect = self.test_config.get
@ -153,7 +154,7 @@ class NovaCCUtilsTests(CharmTestCase):
def test_resource_map_vmware(self, subcontext):
fake_context = MagicMock()
fake_context.return_value = {
'sections': [] ,
'sections': [],
'services': ['nova-compute', 'nova-network'],
}

@ -45,6 +45,7 @@ def get_default_config():
class CharmTestCase(unittest.TestCase):
def setUp(self, obj, patches):
super(CharmTestCase, self).setUp()
self.patches = patches
@ -65,6 +66,7 @@ class CharmTestCase(unittest.TestCase):
class TestConfig(object):
def __init__(self):
self.config = get_default_config()
@ -86,6 +88,7 @@ class TestConfig(object):
class TestRelation(object):
def __init__(self, relation_data={}):
self.relation_data = relation_data