diff --git a/internal/configure/hosts/hc_get.go b/internal/configure/hosts/hc_get.go index e9fce008f..37774c9ae 100644 --- a/internal/configure/hosts/hc_get.go +++ b/internal/configure/hosts/hc_get.go @@ -67,17 +67,7 @@ func (hc *HostConfig) getBool(i *comm.Item) bool { return v.(bool) } -func (hc *HostConfig) getName() string { - res := hc.GetHost() - if res != "" { - return res - } - - return hc.getString(CONFIG_NAME) -} - -func (hc *HostConfig) GetHost() string { return hc.getString(CONFIG_HOST) } -func (hc *HostConfig) GetName() string { return hc.getName() } +func (hc *HostConfig) GetName() string { return hc.getString(CONFIG_NAME) } func (hc *HostConfig) GetHostname() string { return hc.getString(CONFIG_HOSTNAME) } func (hc *HostConfig) GetSSHHostname() string { return hc.getString(CONFIG_SSH_HOSTNAME) } func (hc *HostConfig) GetSSHPort() int { return hc.getInt(CONFIG_SSH_PORT) } diff --git a/internal/configure/hosts/hc_item.go b/internal/configure/hosts/hc_item.go index fcd0714d2..678d7cbad 100644 --- a/internal/configure/hosts/hc_item.go +++ b/internal/configure/hosts/hc_item.go @@ -49,8 +49,11 @@ var ( "name", comm.REQUIRE_STRING, false, - nil, + func(hc *HostConfig) interface{} { + return hc.getString(CONFIG_HOST) + }, ) + CONFIG_HOSTNAME = itemset.Insert( "hostname", comm.REQUIRE_STRING,