Fix normalize_role_assignments() return value
This function was returning plain dicts, not Munch objects, so it was acting differently from all other normalization funtions. Change-Id: Iaf9325d509f9c2c015f9c3fbd2d4ec6efa974429
This commit is contained in:
parent
e39ad09df4
commit
d7ffabca74
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Role assignments were being returned as plain dicts instead of Munch objects.
|
||||||
|
This has been corrected.
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import inspect
|
import inspect
|
||||||
|
import munch
|
||||||
import netifaces
|
import netifaces
|
||||||
import re
|
import re
|
||||||
import six
|
import six
|
||||||
@ -437,7 +438,7 @@ def normalize_role_assignments(assignments):
|
|||||||
"""
|
"""
|
||||||
new_assignments = []
|
new_assignments = []
|
||||||
for assignment in assignments:
|
for assignment in assignments:
|
||||||
new_val = {'id': assignment['role']['id']}
|
new_val = munch.Munch({'id': assignment['role']['id']})
|
||||||
for scope in ('project', 'domain'):
|
for scope in ('project', 'domain'):
|
||||||
if scope in assignment['scope']:
|
if scope in assignment['scope']:
|
||||||
new_val[scope] = assignment['scope'][scope]['id']
|
new_val[scope] = assignment['scope'][scope]['id']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user