Skip to content

Commit

Permalink
Check if profile exists for config rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
lox committed Oct 6, 2015
1 parent 1dad960 commit 2eaa666
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,19 @@ func profileConfig(profile string) (*os.File, error) {
return nil, err
}

p := conf[profile]
for k, _ := range p {
switch k {
case "source_profile", "role_arn":
delete(p, k)
}
// allow some time for keychain prompt
newConfig := map[string]string{
"metadata_service_timeout": "15",
"metadata_service_num_attempts": "2",
}

// allow some time for keychain prompt
p["metadata_service_timeout"] = "15"
p["metadata_service_num_attempts"] = "2"
for k, v := range conf[profile] {
if k != "source_profile" && k != "role_arn" {
newConfig[k] = v
}
}

return tmpConfig, writeProfiles(tmpConfig, profiles{profile: p})
return tmpConfig, writeProfiles(tmpConfig, profiles{profile: newConfig})
}

func overwriteEnv(env []string, key, val string) []string {
Expand Down

0 comments on commit 2eaa666

Please sign in to comment.