remove nodeName call when using -service

- fix #8734
This commit is contained in:
Juliano Martinez 2020-09-23 10:45:16 +02:00
parent e4507ae11e
commit 5ce309a2f7
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()
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
}
if !c.enable && !c.disable {
// List mode - list nodes/services in maintenance mode
checks, err := a.Checks()
if err != nil {