Merge lp:~cprov/charms/precise/rabbitmq-server/rabbit-admin into lp:charms/rabbitmq-server

Proposed by Celso Providelo
Status: Merged
Merged at revision: 57
Proposed branch: lp:~cprov/charms/precise/rabbitmq-server/rabbit-admin
Merge into: lp:charms/rabbitmq-server
Diff against target: 29 lines (+4/-3)
1 file modified
hooks/rabbitmq_server_relations.py (+4/-3)
To merge this branch: bzr merge lp:~cprov/charms/precise/rabbitmq-server/rabbit-admin
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
James Page Approve
Tom Haddon Pending
Review via email: mp+233205@code.launchpad.net

Description of the change

This branch extends the amqp relationship to support an optional parameter 'admin'. If it's present and non-empty the context user will be created/update with admin rights.

The motivation for this branch is to allow joined instances to access the management-plugin API (e.g. http://<rabbit>:55672/api/[queues,...]).

It's unfortunate, to say the least, that we have to grant unrestricted admin rights for performing read-only diagnose/monitoring requests, but the management-plugin does not seem to offer any other alternative.

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :
Revision history for this message
Tom Haddon (mthaddon) wrote :

I think this looks okay, but I'd like to confirm how https://launchpad.net/~openstack-charmers feel about it, given rabbitmq is a core piece of openstack infrastructure.

Revision history for this message
James Page (james-page) :
review: Approve
Revision history for this message
Charles Butler (lazypower) wrote :

Thanks for the contribution Celso!

I've validated and merged. if this needs to be promoted against the trusty version of the charm please open another MP targeted at trusty, as this was only targeted against precise I did not promote to series: trusty.

Thanks again!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/rabbitmq_server_relations.py'
2--- hooks/rabbitmq_server_relations.py 2014-06-30 10:26:02 +0000
3+++ hooks/rabbitmq_server_relations.py 2014-09-03 12:53:06 +0000
4@@ -68,13 +68,13 @@
5 # NOTE(jamespage) install actually happens in config_changed hook
6
7
8-def configure_amqp(username, vhost):
9+def configure_amqp(username, vhost, admin=False):
10 # get and update service password
11 password = rabbit.get_rabbit_password(username)
12
13 # update vhost
14 rabbit.create_vhost(vhost)
15- rabbit.create_user(username, password)
16+ rabbit.create_user(username, password, admin)
17 rabbit.grant_permissions(username, vhost)
18
19 return password
20@@ -99,7 +99,8 @@
21
22 relation_settings['password'] = configure_amqp(
23 username=settings['username'],
24- vhost=settings['vhost'])
25+ vhost=settings['vhost'],
26+ admin=settings.get('admin', False))
27 else:
28 queues = {}
29 for k, v in settings.iteritems():

Subscribers

People subscribed via source and target branches