-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow "[profile default]" in .aws/config #484
Allow "[profile default]" in .aws/config #484
Conversation
Seems reasonable. Needs a test though |
The awscli allows either a section [default] or [profile default] in the aws config file.
2b30d5b
to
21dc437
Compare
Test added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM!
bors try
@testset "default profile section names" begin | ||
allowed_default_sections = ["default", "profile default"] | ||
mktemp() do config_path, _ | ||
for default_section_str in allowed_default_sections | ||
config = """ | ||
[$default_section_str] | ||
region = xx-yy-1 | ||
""" | ||
write(config_path, config) | ||
@test aws_get_region(; profile="default", config=config_path) == "xx-yy-1" | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is the proper syntax.
@testset "default profile section names" begin | |
allowed_default_sections = ["default", "profile default"] | |
mktemp() do config_path, _ | |
for default_section_str in allowed_default_sections | |
config = """ | |
[$default_section_str] | |
region = xx-yy-1 | |
""" | |
write(config_path, config) | |
@test aws_get_region(; profile="default", config=config_path) == "xx-yy-1" | |
end | |
end | |
end | |
@testset "$(profile) section names" for profile in ["default", "profile_default"] | |
mktemp() do config_path, _ | |
config = """ | |
[$(profile)] | |
region = xx-yy-1 | |
""" | |
write(config_path, config) | |
@test aws_get_region(; profile="default", config=config_path) == "xx-yy-1" | |
end | |
end | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, if you want two test sets with a single test in them each, feel free to commit something like this.
Note, however that this patch is wrong because we want to test profile == "profile default"
(not "profile_default"
with an underscore).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nbd, I just find different cases in a @testset
are easier to debug.
bors r+ |
The awscli allows either a section
[default]
or[profile default]
inthe aws config file.
I had
[profile default]
in my config and was surprised when this worked with awscli but not with AWS.jl.