Move parsing of vault token above validation such that it works in dev mode

This commit is contained in:
Alex Dadgar 2016-11-10 11:47:43 -08:00
parent 24ff5fc5b4
commit e322f5c070
1 changed files with 7 additions and 7 deletions

View File

@ -207,6 +207,13 @@ func (c *Command) readConfig() *Config {
return nil return nil
} }
// Check to see if we should read the Vault token from the environment
if config.Vault.Token == "" {
if token, ok := os.LookupEnv("VAULT_TOKEN"); ok {
config.Vault.Token = token
}
}
if dev { if dev {
// Skip validation for dev mode // Skip validation for dev mode
return config return config
@ -278,13 +285,6 @@ func (c *Command) readConfig() *Config {
c.Ui.Error("WARNING: Bootstrap mode enabled! Potentially unsafe operation.") c.Ui.Error("WARNING: Bootstrap mode enabled! Potentially unsafe operation.")
} }
// Check to see if we should read the Vault token from the environment
if config.Vault.Token == "" {
if token, ok := os.LookupEnv("VAULT_TOKEN"); ok {
config.Vault.Token = token
}
}
return config return config
} }