mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
Detect a half-byte prefix and display a user-friendly error.
This commit is contained in:
@@ -110,6 +110,11 @@ func (c *NodeStatusCommand) Run(args []string) int {
|
||||
nodeID := args[0]
|
||||
node, _, err := client.Nodes().Info(nodeID, nil)
|
||||
if err != nil {
|
||||
if len(nodeID)%2 != 0 {
|
||||
c.Ui.Error(fmt.Sprintf("Identifier (without hyphens) must be of even length."))
|
||||
return 1
|
||||
}
|
||||
|
||||
// Exact lookup failed, try with prefix based search
|
||||
nodes, _, err := client.Nodes().PrefixList(nodeID)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user