Skip to content

Commit

Permalink
Update config_file_writer.py for boto3 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
benkehoe committed Jul 26, 2023
1 parent ee401f4 commit 591c9de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws_export_credentials/config_file_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class SectionNotFoundError(Exception):
pass

def get_config_filename(session):
# get botocore session if it's a boto3 session
if hasattr(session, "_session"):
session = session._session
return os.path.expanduser(session.get_config_variable('config_file'))

_WHITESPACE = ' \t'
Expand All @@ -30,6 +33,9 @@ def process_profile_name(profile_name):
return profile_name

def write_values(session, profile_name, values, config_file_writer=None, existing_config_action=None):
# get botocore session if it's a boto3 session
if hasattr(session, "_session"):
session = session._session
if not config_file_writer:
config_file_writer = ConfigFileWriter()

Expand Down

0 comments on commit 591c9de

Please sign in to comment.