Skip to content

Commit

Permalink
fix(iam, set_iam_credentials): utilize force_lowercase connection opt
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooke-white committed Aug 16, 2021
1 parent 727b8fc commit 3348262
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion redshift_connector/iam_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ def set_iam_properties(info: RedshiftProperty) -> RedshiftProperty:
ClientProtocolVersion.list()
)
)

if info.db_groups and info.force_lowercase:
info.put("db_groups", [group.lower() for group in info.db_groups])

if info.iam is True:
if info.cluster_identifier is None:
raise InterfaceError(
Expand Down Expand Up @@ -308,7 +312,10 @@ def set_iam_credentials(info: RedshiftProperty) -> None:
info.put("db_user", saml_db_user)

if (len(info.db_groups) == 0) and (len(db_groups) > 0):
info.put("db_groups", db_groups)
if force_lowercase:
info.db_groups = [group.lower() for group in db_groups]
else:
info.db_groups = db_groups

IamHelper.set_cluster_credentials(provider, info)

Expand Down

0 comments on commit 3348262

Please sign in to comment.