Guard against a node name containing pure whitespace
This commit is contained in:
parent
c03d025903
commit
faa2aa4436
|
@ -167,14 +167,13 @@ func (c *Command) readConfig() *Config {
|
|||
c.Ui.Error(fmt.Sprintf("Error determining node name: %s", err))
|
||||
return nil
|
||||
}
|
||||
|
||||
hostname = strings.TrimSpace(hostname)
|
||||
if hostname == "" {
|
||||
c.Ui.Error("Node name can not be empty")
|
||||
return nil
|
||||
}
|
||||
config.NodeName = hostname
|
||||
}
|
||||
hostname = strings.TrimSpace(hostname)
|
||||
if hostname == "" {
|
||||
c.Ui.Error("Node name can not be empty")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Ensure we have a data directory
|
||||
if config.DataDir == "" && !dev {
|
||||
|
|
Loading…
Reference in New Issue