Merge pull request #8735 from ncode/master

remove nodeName call when using -service
This commit is contained in:
Daniel Nephin 2020-09-24 13:31:09 -04:00 committed by hashicorp-ci
parent e22b295b5f
commit 3f00c428af

View File

@ -72,13 +72,14 @@ func (c *cmd) Run(args []string) int {
return 1
}
a := client.Agent()
nodeName, err := a.NodeName()
if err != nil {
c.UI.Error(fmt.Sprintf("Error querying Consul agent: %s", err))
return 1
}
if !c.enable && !c.disable {
nodeName, err := a.NodeName()
if err != nil {
c.UI.Error(fmt.Sprintf("Error querying Consul agent: %s", err))
return 1
}
// List mode - list nodes/services in maintenance mode
checks, err := a.Checks()
if err != nil {