Adds check for swift_operator_role, else exit
This commit is contained in:
parent
079bf57d19
commit
3d9e44c2b9
|
@ -86,6 +86,10 @@ def create_swift_user(client, account_name, account_id, user_amount):
|
||||||
# Get swift_operator_role id
|
# Get swift_operator_role id
|
||||||
roleid = [role.id for role in client.roles.list()
|
roleid = [role.id for role in client.roles.list()
|
||||||
if role.name == get_config('filler', 'swift_operator_role')]
|
if role.name == get_config('filler', 'swift_operator_role')]
|
||||||
|
if not roleid:
|
||||||
|
logging.error('Could not find swift_operator_role %s in keystone' %
|
||||||
|
get_config('filler', 'swift_operator_role'))
|
||||||
|
sys.exit(1)
|
||||||
roleid = roleid[0]
|
roleid = roleid[0]
|
||||||
# Add tenant/user in swift operator role/group
|
# Add tenant/user in swift operator role/group
|
||||||
client.roles.add_user_role(uid.id, roleid, account_id)
|
client.roles.add_user_role(uid.id, roleid, account_id)
|
||||||
|
|
Loading…
Reference in New Issue