status commands handle uuid prefixes with hyphens

This commit is contained in:
Alex Dadgar
2017-08-29 09:43:28 -07:00
parent 6fb08b844b
commit 0852c0ab3a
7 changed files with 7 additions and 7 deletions

View File

@@ -231,7 +231,7 @@ func (c *NodeStatusCommand) Run(args []string) int {
c.Ui.Error(fmt.Sprintf("Identifier must contain at least two characters."))
return 1
}
if len(nodeID)%2 == 1 {
if hyphens := strings.Count(nodeID, "-"); (len(nodeID)-hyphens)%2 == 1 {
// Identifiers must be of even length, so we strip off the last byte
// to provide a consistent user experience.
nodeID = nodeID[:len(nodeID)-1]