Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/aws/sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ def sso_login(profile_group: ProfileGroup) -> Result:
# unset AWS_PROFILE and AWS_DEFAULT_PROFILE because sso login fails is profile is present
# or aborts when profiles are not found.
return shell.run(
command=f"unset AWS_PROFILE && unset AWS_DEFAULT_PROFILE && aws sso login --sso-session {sso_session_name}",
command=f"env -u AWS_PROFILE -u AWS_DEFAULT_PROFILE aws sso login --sso-session {sso_session_name}",
timeout=600,
)


def sso_logout() -> Result:
return shell.run(
command=f"unset AWS_PROFILE && unset AWS_DEFAULT_PROFILE && aws sso logout",
command=f"env -u AWS_PROFILE -u AWS_DEFAULT_PROFILE aws sso logout",
timeout=600,
)
4 changes: 2 additions & 2 deletions tests/test_aws/test_sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def test_sso_login(mocker):
result = sso.sso_login(profile_group)

expected_command = (
"unset AWS_PROFILE && unset AWS_DEFAULT_PROFILE && aws sso login --sso-session specific-sso-session"
"env -u AWS_PROFILE -u AWS_DEFAULT_PROFILE aws sso login --sso-session specific-sso-session"
)
mock_shell_run.assert_called_once_with(command=expected_command, timeout=600)
assert result.was_success
Expand All @@ -594,7 +594,7 @@ def test_sso_logout(mocker):

result = sso.sso_logout()

expected_command = "unset AWS_PROFILE && unset AWS_DEFAULT_PROFILE && aws sso logout"
expected_command = "env -u AWS_PROFILE -u AWS_DEFAULT_PROFILE aws sso logout"
mock_shell_run.assert_called_once_with(command=expected_command, timeout=600)
assert result.was_success

Expand Down
Loading