"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/test_v3.py" between
keystone-16.0.0.tar.gz and keystone-16.0.1.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Train" series (latest release).

test_v3.py  (keystone-16.0.0):test_v3.py  (keystone-16.0.1)
skipping to change at line 1399 skipping to change at line 1399
return '/role_assignments%s' % query_params return '/role_assignments%s' % query_params
def build_role_assignment_link(self, **attribs): def build_role_assignment_link(self, **attribs):
"""Build and return a role assignment link with provided attributes. """Build and return a role assignment link with provided attributes.
Provided attributes are expected to contain: domain_id or project_id, Provided attributes are expected to contain: domain_id or project_id,
user_id or group_id, role_id and, optionally, inherited_to_projects. user_id or group_id, role_id and, optionally, inherited_to_projects.
""" """
if attribs.get('domain_id'): if attribs.get('domain_id'):
link = '/domains/' + attribs['domain_id'] link = '/domains/' + attribs['domain_id']
elif attribs.get('system'):
link = '/system'
else: else:
link = '/projects/' + attribs['project_id'] link = '/projects/' + attribs['project_id']
if attribs.get('user_id'): if attribs.get('user_id'):
link += '/users/' + attribs['user_id'] link += '/users/' + attribs['user_id']
else: else:
link += '/groups/' + attribs['group_id'] link += '/groups/' + attribs['group_id']
link += '/roles/' + attribs['role_id'] link += '/roles/' + attribs['role_id']
skipping to change at line 1426 skipping to change at line 1428
"""Build and return a role assignment entity with provided attributes. """Build and return a role assignment entity with provided attributes.
Provided attributes are expected to contain: domain_id or project_id, Provided attributes are expected to contain: domain_id or project_id,
user_id or group_id, role_id and, optionally, inherited_to_projects. user_id or group_id, role_id and, optionally, inherited_to_projects.
""" """
entity = {'links': {'assignment': ( entity = {'links': {'assignment': (
link or self.build_role_assignment_link(**attribs))}} link or self.build_role_assignment_link(**attribs))}}
if attribs.get('domain_id'): if attribs.get('domain_id'):
entity['scope'] = {'domain': {'id': attribs['domain_id']}} entity['scope'] = {'domain': {'id': attribs['domain_id']}}
elif attribs.get('system'):
entity['scope'] = {'system': {'all': True}}
else: else:
entity['scope'] = {'project': {'id': attribs['project_id']}} entity['scope'] = {'project': {'id': attribs['project_id']}}
if attribs.get('user_id'): if attribs.get('user_id'):
entity['user'] = {'id': attribs['user_id']} entity['user'] = {'id': attribs['user_id']}
if attribs.get('group_id'): if attribs.get('group_id'):
entity['links']['membership'] = ('/groups/%s/users/%s' % entity['links']['membership'] = ('/groups/%s/users/%s' %
(attribs['group_id'], (attribs['group_id'],
attribs['user_id'])) attribs['user_id']))
 End of changes. 2 change blocks. 
0 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)