Skip to content

Commit

Permalink
No longer copy profile name when copying session
Browse files Browse the repository at this point in the history
Create-quantum-job was throwing "botocore.exceptions.ProfileNotFound:
The config profile (default) could not be found" since the container
does not have a profile "default" configuration. There are some
potential workarounds but the easiest is to just remove setting
the profile name all together. Since we are already copying the
credentials and region there really is no value in copying the profile
hence this change.
  • Loading branch information
Derek Bolt🐾 authored and dbolt committed Dec 18, 2019
1 parent 27a5e92 commit 7689c85
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion src/braket/aws/aws_qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def _aws_session_for_qpu(self, qpu_arn: str, aws_session: AwsSession) -> AwsSess
aws_access_key_id=creds.access_key,
aws_secret_access_key=creds.secret_key,
aws_session_token=creds.token,
profile_name=aws_session.boto_session.profile_name,
region_name=qpu_regions[0],
)
return AwsSession(boto_session=boto_session)
Expand Down
3 changes: 1 addition & 2 deletions test/unit_tests/braket/aws/test_aws_qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,11 @@ def test_aws_session_in_another_qpu_region(

AwsQpu(arn, different_region_aws_session)

# assert creds, profile, and region were correctly supplied
# assert creds, and region were correctly supplied
boto_session_init.assert_called_with(
aws_access_key_id=creds.access_key,
aws_secret_access_key=creds.secret_key,
aws_session_token=creds.token,
profile_name=different_region_aws_session.boto_session.profile_name,
region_name=region,
)

Expand Down

0 comments on commit 7689c85

Please sign in to comment.