From e1fb12f0730afd7a71f8cf5f9815cce5f3f5e78c Mon Sep 17 00:00:00 2001 From: Ronald Ekambi Date: Fri, 3 Mar 2023 11:32:36 -0500 Subject: [PATCH] fix order of fn --- command/acl/token/update/token_update.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/command/acl/token/update/token_update.go b/command/acl/token/update/token_update.go index 9d68c5def7..519a3da8d4 100644 --- a/command/acl/token/update/token_update.go +++ b/command/acl/token/update/token_update.go @@ -157,11 +157,6 @@ func (c *cmd) Run(args []string) int { hasAppendServiceFields := len(c.appendServiceIdents) > 0 hasServiceFields := len(c.serviceIdents) > 0 - parsedServiceIdents, err := acl.ExtractServiceIdentities(c.serviceIdents) - if hasAppendServiceFields { - parsedServiceIdents, err = acl.ExtractServiceIdentities(c.appendServiceIdents) - } - if hasAppendServiceFields && hasServiceFields { c.UI.Error("Cannot combine the use of service-identity flag with append-service-identity. " + "To set or overwrite existing service identities, use -service-identity. " + @@ -169,6 +164,10 @@ func (c *cmd) Run(args []string) int { return 1 } + parsedServiceIdents, err := acl.ExtractServiceIdentities(c.serviceIdents) + if hasAppendServiceFields { + parsedServiceIdents, err = acl.ExtractServiceIdentities(c.appendServiceIdents) + } if err != nil { c.UI.Error(err.Error()) return 1