Skip to content

Commit

Permalink
Update to use deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljcollinsuk committed Jan 12, 2024
1 parent 121baf4 commit 6524d72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controlpanel/api/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def oidc_provider_statement(self):
return json.loads(statement)

def create_iam_role(self):
assume_role_policy = BASE_ASSUME_ROLE_POLICY.copy()
assume_role_policy = deepcopy(BASE_ASSUME_ROLE_POLICY)
assume_role_policy["Statement"].append(self.oidc_provider_statement)
self.aws_role_service.create_role(self.iam_role_name, assume_role_policy)

Expand Down
3 changes: 2 additions & 1 deletion tests/api/cluster/test_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Standard library
from copy import deepcopy
from unittest.mock import MagicMock, patch

# Third-party
Expand Down Expand Up @@ -76,7 +77,7 @@ def test_oidc_provider_statement(app, oidc_provider_statement):


def test_app_create_iam_role(aws_create_role, app, oidc_provider_statement):
expected_assume_role = BASE_ASSUME_ROLE_POLICY.copy()
expected_assume_role = deepcopy(BASE_ASSUME_ROLE_POLICY)
expected_assume_role["Statement"].append(oidc_provider_statement)

cluster.App(app).create_iam_role()
Expand Down

0 comments on commit 6524d72

Please sign in to comment.