Skip to content

creates the .aws home directory if it doesn't exist#3

Open
morganda wants to merge 1 commit intoelastic:masterfrom
morganda:create_home_aws_dir_if_not_exists
Open

creates the .aws home directory if it doesn't exist#3
morganda wants to merge 1 commit intoelastic:masterfrom
morganda:create_home_aws_dir_if_not_exists

Conversation

@morganda
Copy link
Copy Markdown

@morganda morganda commented Mar 8, 2019

I updated the initial setup so that it would create the $HOME/.aws directory as well as the credentials file if it doesn't exist to make initial setup a bit smoother. I can create tests for this if desired, but I didn't see any others so I passed for now. That said it worked fine locally - below you can see the output.

[morgana@Morgans-MacBook-Pro:~/src/aws-mfa]
>>>aws-mfa - master
$>rm -rf ~/.aws

[morgana@Morgans-MacBook-Pro:~/src/aws-mfa]
>>>aws-mfa - master
$>aws-mfa --setup
Could not locate credentials file at /Users/morgana/.aws/credentials, would you like to create one? [y/n]y
Profile name to [default]:
...

[morgana@Morgans-MacBook-Pro:~/src/aws-mfa]
>>>aws-mfa - create_home_aws_dir_if_not_exists
$>ls -al ~/.aws/credentials
-rw-r--r--  1 morgana  staff  0 Mar  8 11:27 /Users/morgana/.aws/credentials

Additionally, I used f-strings, but I'm not sure if we want to maintain python2 compatibility. Thoughts?

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.

1 participant