[Tempest context]Ignore case of role names

Change all names to lower case while matching them.

Change-Id: I5bebd29db1530acb7eefe044359d249b774493c5
This commit is contained in:
chenhb 2019-03-14 20:39:40 +08:00
parent 9924198284
commit 84638866af

View File

@ -125,10 +125,11 @@ class TempestContext(context.VerifierContext):
conf.CONF.openstack.swift_reseller_admin_role,
conf.CONF.openstack.heat_stack_owner_role,
conf.CONF.openstack.heat_stack_user_role]
existing_roles = set(role.name for role in keystoneclient.roles.list())
existing_roles = set(role.name.lower()
for role in keystoneclient.roles.list())
for role in roles:
if role not in existing_roles:
if role.lower() not in existing_roles:
LOG.debug("Creating role '%s'." % role)
self._created_roles.append(keystoneclient.roles.create(role))