remove nodeName call when using -service

- fix #8734
This commit is contained in:
Juliano Martinez 2020-09-23 10:45:16 +02:00
parent f6fafe0ed1
commit 7b7aba0f7f
1 changed files with 6 additions and 5 deletions

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 {