Skip to content

Commit

Permalink
KV command does not pass CONSUL_HTTP_TOKEN (hashicorp#2566)
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkumar-m authored and Anthony O'Brien committed Jan 16, 2017
1 parent 1380fdb commit e690216
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion command/kv_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ func (c *KVDeleteCommand) Run(args []string) int {
// Create and test the HTTP client
conf := api.DefaultConfig()
conf.Address = *httpAddr
conf.Token = *token
if *token != "" {
conf.Token = *token
}
client, err := api.NewClient(conf)
if err != nil {
c.Ui.Error(fmt.Sprintf("Error connecting to Consul agent: %s", err))
Expand Down
4 changes: 3 additions & 1 deletion command/kv_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ func (c *KVGetCommand) Run(args []string) int {
// Create and test the HTTP client
conf := api.DefaultConfig()
conf.Address = *httpAddr
conf.Token = *token
if *token != "" {
conf.Token = *token
}
client, err := api.NewClient(conf)
if err != nil {
c.Ui.Error(fmt.Sprintf("Error connecting to Consul agent: %s", err))
Expand Down
4 changes: 3 additions & 1 deletion command/kv_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ func (c *KVPutCommand) Run(args []string) int {
// Create and test the HTTP client
conf := api.DefaultConfig()
conf.Address = *httpAddr
conf.Token = *token
if *token != "" {
conf.Token = *token
}
client, err := api.NewClient(conf)
if err != nil {
c.Ui.Error(fmt.Sprintf("Error connecting to Consul agent: %s", err))
Expand Down

0 comments on commit e690216

Please sign in to comment.