Merge lp:~yolanda.robla/charms/precise/keystone/ha-support into lp:~openstack-charmers/charms/precise/keystone/ha-support

Proposed by Yolanda Robla
Status: Merged
Approved by: Adam Gandelman
Approved revision: 70
Merged at revision: 64
Proposed branch: lp:~yolanda.robla/charms/precise/keystone/ha-support
Merge into: lp:~openstack-charmers/charms/precise/keystone/ha-support
Diff against target: 43 lines (+11/-10)
2 files modified
hooks/keystone_hooks.py (+10/-9)
revision (+1/-1)
To merge this branch: bzr merge lp:~yolanda.robla/charms/precise/keystone/ha-support
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+157834@code.launchpad.net

Description of the change

Associating user with role, when requested_roles setting is specified

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 'hooks/keystone_hooks.py'
2--- hooks/keystone_hooks.py 2013-04-04 23:39:30 +0000
3+++ hooks/keystone_hooks.py 2013-04-09 10:00:33 +0000
4@@ -211,15 +211,6 @@
5 settings = utils.relation_get_dict(relation_id=relation_id,
6 remote_unit=remote_unit)
7
8- # Allow the remote service to request creation of any additional roles.
9- # Currently used by Swift.
10- if 'requested_roles' in settings and settings['requested_roles'] != 'None':
11- roles = settings['requested_roles'].split(',')
12- utils.juju_log('INFO',
13- "Creating requested roles: %s" % roles)
14- for role in roles:
15- create_role(role, user=config['admin-user'], tenant='admin')
16-
17 # the minimum settings needed per endpoint
18 single = set(['service', 'region', 'public_url', 'admin_url',
19 'internal_url'])
20@@ -315,6 +306,16 @@
21 grant_role(service_username, config['admin-role'],
22 config['service-tenant'])
23
24+ # Allow the remote service to request creation of any additional roles.
25+ # Currently used by Swift and Ceilometer.
26+ if 'requested_roles' in settings and settings['requested_roles'] != 'None':
27+ roles = settings['requested_roles'].split(',')
28+ utils.juju_log('INFO',
29+ "Creating requested roles: %s" % roles)
30+ for role in roles:
31+ create_role(role, service_username, config['service-tenant'])
32+ grant_role(service_username, role, config['service-tenant'])
33+
34 # As of https://review.openstack.org/#change,4675, all nodes hosting
35 # an endpoint(s) needs a service username and password assigned to
36 # the service tenant and granted admin role.
37
38=== modified file 'revision'
39--- revision 2013-04-04 23:39:30 +0000
40+++ revision 2013-04-09 10:00:33 +0000
41@@ -1,1 +1,1 @@
42-213
43+217

Subscribers

People subscribed via source and target branches