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

Read creds from file #115

Merged
merged 2 commits into from Sep 3, 2015

Conversation

Projects
None yet
2 participants
@csquared
Copy link
Contributor

csquared commented Sep 2, 2015

YAY! you can now do:

convox install ~/Downloads/credentials.csv and not have to copy and paste anything. kinda got annoying there.

@@ -181,6 +210,7 @@ func cmdInstall(c *cli.Context) {

development := "No"
if c.Bool("development") {
isDevelopment = true

This comment has been minimized.

@ddollar

ddollar Sep 3, 2015

Contributor

do we need the extra variable as long as development is not re-set?

This comment has been minimized.

@csquared

csquared Sep 3, 2015

Author Contributor

not necessarly, but i wanted the global to be a boolean so it can have meaning other than being the string "Yes" or "No". (first bug i can see ther is checking development == "yes").

The string development (which needs to be "Yes" or "No") is geting passed in as a stack param. However, you need to check if the development flag is set deep in for loop of waitForCompletion. So we could also pass it in as a param there.

This comment has been minimized.

@csquared

csquared Sep 3, 2015

Author Contributor

more consicely, development and isDevelopment have different scopes and uses. former is a param, latter is a flag

access := os.Getenv("AWS_ACCESS_KEY_ID")
secret := os.Getenv("AWS_SECRET_ACCESS_KEY")

// read credentials from credentials.csv file
if len(c.Args()) > 0 {

This comment has been minimized.

@ddollar

ddollar Sep 3, 2015

Contributor

how does this behave if you give it a garbage csv?

This comment has been minimized.

@csquared

csquared Sep 3, 2015

Author Contributor

if it can't read the file:

ERROR: open fooo: no such file or directory

if there are not enough rows, it skips the file and prompts

if there are enough rows, you'll get a credentials error:

Installing Convox...
ERROR: InvalidClientTokenId: The security token included in the request is invalid.
    status code: 403, request id: [01747b05-51d6-11e5-a3c9-8db7128b28df]
@@ -294,6 +324,27 @@ func cmdUninstall(c *cli.Context) {
secret := os.Getenv("AWS_SECRET_ACCESS_KEY")
region := c.String("region")

// read credentials from credentials.csv file
if len(c.Args()) > 0 {
credentialsCsvFileName := c.Args()[0]

This comment has been minimized.

@ddollar

ddollar Sep 3, 2015

Contributor

might be worth factoring this out into a function

This comment has been minimized.

@csquared

csquared Sep 3, 2015

Author Contributor

see: #116

csquared added a commit that referenced this pull request Sep 3, 2015

@csquared csquared merged commit 1ad6fd6 into master Sep 3, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@csquared csquared deleted the read-creds-from-file branch Sep 3, 2015

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