Skip to content

Commit

Permalink
hashicorp#2087 gracefully handle non-presence of service on remote co…
Browse files Browse the repository at this point in the history
…nsul agent
  • Loading branch information
maxenglander committed Jul 6, 2016
1 parent df4c0c8 commit 6e40210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/providers/consul/resource_consul_agent_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func resourceConsulAgentServiceRead(d *schema.ResourceData, meta interface{}) er
if services, err := agent.Services(); err != nil {
return fmt.Errorf("Failed to get services from Consul agent: %v", err)
} else if service, ok := services[name]; !ok {
return fmt.Errorf("Failed to get service '%s' from Consul agent", name)
d.Set("id", "")
} else {
d.Set("address", service.Address)
d.Set("id", service.ID)
Expand Down

0 comments on commit 6e40210

Please sign in to comment.