Skip to content

Fix configure set handling of profile-prefixed dotted varnames#10323

Open
mohitkum4r wants to merge 2 commits into
aws:developfrom
mohitkum4r:fix-configure-set-profile-prefix
Open

Fix configure set handling of profile-prefixed dotted varnames#10323
mohitkum4r wants to merge 2 commits into
aws:developfrom
mohitkum4r:fix-configure-set-profile-prefix

Conversation

@mohitkum4r
Copy link
Copy Markdown

Description

This PR fixes a bug (Issue #10313) where aws configure set mishandles profile-prefixed dotted varnames.

When executing a command like aws configure set emr-dev.emr.instance_profile my_ip (where emr-dev is an existing profile), the command previously failed to recognize emr-dev as the target profile. Instead, it would write to the [default] profile, mapping the key emr-dev to my_ip.

The Fix:

I've updated awscli/customizations/configure/set.py to mirror the profile detection logic currently used by configure get (get.py). When parsing a dotted varname, it now explicitly checks if the first segment is default or exists within the session's loaded profiles configuration. If a match is found, it correctly assigns the value to that specific nested profile section.

This ensures the syntax for reading and writing profile-scoped multi-part variables is perfectly symmetrical.

Testing

  • Added tests to test_set.py mimicking the FakeSession setup from test_get.py.
  • All 123 configure unit and functional tests execute successfully:
    pytest tests/unit/customizations/configure/ tests/functional/configure/

Resolves #10313.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure set mishandles profile-prefixed dotted varnames (inconsistent with configure get)

1 participant