From 12d8f0f4b0dce277bd51e2a23ce32399b9d11464 Mon Sep 17 00:00:00 2001 From: Igor Perepilitsyn Date: Mon, 2 May 2022 14:00:00 +0400 Subject: [PATCH] remove redundant lines of code, fix response when output is not plain text --- cmd/headscale/cli/nodes.go | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 1a823ac6..aafd9b9c 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -381,28 +381,7 @@ var moveNodeCmd = &cobra.Command{ return } - if output != "" { - SuccessOutput(moveResponse, "", output) - - return - } - if err != nil { - ErrorOutput( - err, - fmt.Sprintf( - "Error moving node: %s", - status.Convert(err).Message(), - ), - output, - ) - - return - } - SuccessOutput( - map[string]string{"Result": "Node moved to another namespace"}, - "Node moved to another namespace", - output, - ) + SuccessOutput(moveResponse.Machine, "Node moved to another namespace", output) }, }