Update dynamic creds to properly handle types during creation

A recent change modified how credential_types are passed into
_create_creds:

  https://review.opendev.org/c/openstack/tempest/+/773177

This change updates the code to check for types and only cast creds to a
list if it's a string.

It also adds a condition to only create a project role assignment if the
credential type is project-scoped. Otherwise, this fails with
system-scoped credentials.

Change-Id: I010434e1a97520cc7a55384af55e0b61ee4e2556
1 file changed