Merge lp:~openstack-charmers/charms/precise/nova-compute/ceilometer-support into lp:~charmers/charms/precise/nova-compute/trunk

Proposed by James Page
Status: Merged
Merged at revision: 49
Proposed branch: lp:~openstack-charmers/charms/precise/nova-compute/ceilometer-support
Merge into: lp:~charmers/charms/precise/nova-compute/trunk
Diff against target: 59 lines (+13/-5)
3 files modified
config.yaml (+1/-1)
hooks/nova_compute_hooks.py (+10/-3)
unit_tests/test_nova_compute_hooks.py (+2/-1)
To merge this branch: bzr merge lp:~openstack-charmers/charms/precise/nova-compute/ceilometer-support
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+194043@code.launchpad.net

Description of the change

Add support for ceilometer use

Need to be merge alongside associated merge proposal for nova-compute and quantum-gateway due to vhost change across all openstack charms.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2013-08-13 22:03:53 +0000
3+++ config.yaml 2013-11-06 00:53:48 +0000
4@@ -23,7 +23,7 @@
5 type: string
6 description: Username used to access rabbitmq queue
7 rabbit-vhost:
8- default: nova
9+ default: openstack
10 type: string
11 decsription: Rabbitmq vhost
12 database-user:
13
14=== modified file 'hooks/nova_compute_hooks.py'
15--- hooks/nova_compute_hooks.py 2013-09-27 16:20:42 +0000
16+++ hooks/nova_compute_hooks.py 2013-11-06 00:53:48 +0000
17@@ -81,9 +81,10 @@
18
19
20 @hooks.hook('amqp-relation-joined')
21-@restart_on_change(restart_map())
22-def amqp_joined():
23- relation_set(username=config('rabbit-user'), vhost=config('rabbit-vhost'))
24+def amqp_joined(relation_id=None):
25+ relation_set(relation_id=relation_id,
26+ username=config('rabbit-user'),
27+ vhost=config('rabbit-vhost'))
28
29
30 @hooks.hook('amqp-relation-changed')
31@@ -199,6 +200,12 @@
32 CONFIGS.write_all()
33
34
35+@hooks.hook('upgrade-charm')
36+def upgrade_charm():
37+ for r_id in relation_ids('amqp'):
38+ amqp_joined(relation_id=r_id)
39+
40+
41 def main():
42 try:
43 hooks.execute(sys.argv)
44
45=== added symlink 'hooks/upgrade-charm'
46=== target is u'nova_compute_hooks.py'
47=== modified file 'unit_tests/test_nova_compute_hooks.py'
48--- unit_tests/test_nova_compute_hooks.py 2013-09-27 16:20:42 +0000
49+++ unit_tests/test_nova_compute_hooks.py 2013-11-06 00:53:48 +0000
50@@ -105,7 +105,8 @@
51
52 def test_amqp_joined(self):
53 hooks.amqp_joined()
54- self.relation_set.assert_called_with(username='nova', vhost='nova')
55+ self.relation_set.assert_called_with(username='nova', vhost='openstack',
56+ relation_id=None)
57
58 @patch.object(hooks, 'CONFIGS')
59 def test_amqp_changed_missing_relation_data(self, configs):

Subscribers

People subscribed via source and target branches