From 3d9e44c2b9bc97b2cee6c4e50e8c777aec906a42 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Thu, 7 Nov 2013 11:29:09 -0500 Subject: [PATCH] Adds check for swift_operator_role, else exit --- swsync/filler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swsync/filler.py b/swsync/filler.py index 69c826d..4be7624 100644 --- a/swsync/filler.py +++ b/swsync/filler.py @@ -86,6 +86,10 @@ def create_swift_user(client, account_name, account_id, user_amount): # Get swift_operator_role id roleid = [role.id for role in client.roles.list() 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] # Add tenant/user in swift operator role/group client.roles.add_user_role(uid.id, roleid, account_id)