Use node.NewInfo constructor in configure hostfile
Also used in overlay, as I was looking there already. Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
@@ -20,10 +20,11 @@ func Hostfile() error {
|
|||||||
wwlog.Error("'the overlay template '/etc/hosts.ww' does not exists in 'host' overlay")
|
wwlog.Error("'the overlay template '/etc/hosts.ww' does not exists in 'host' overlay")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
var nodeInfo node.NodeInfo
|
|
||||||
tstruct := overlay.InitStruct(nodeInfo)
|
nodeInfo := node.NewInfo()
|
||||||
hostname, _ := os.Hostname()
|
hostname, _ := os.Hostname()
|
||||||
nodeInfo.Id.Set(hostname)
|
nodeInfo.Id.Set(hostname)
|
||||||
|
tstruct := overlay.InitStruct(nodeInfo)
|
||||||
buffer, backupFile, writeFile, err := overlay.RenderTemplateFile(
|
buffer, backupFile, writeFile, err := overlay.RenderTemplateFile(
|
||||||
hostTemplate,
|
hostTemplate,
|
||||||
tstruct)
|
tstruct)
|
||||||
|
|||||||
@@ -81,14 +81,11 @@ func BuildSpecificOverlays(nodes []node.NodeInfo, overlayNames []string) error {
|
|||||||
Build overlay for the host, so no argument needs to be given
|
Build overlay for the host, so no argument needs to be given
|
||||||
*/
|
*/
|
||||||
func BuildHostOverlay() error {
|
func BuildHostOverlay() error {
|
||||||
var host node.NodeInfo
|
host := node.NewInfo()
|
||||||
host.Kernel = new(node.KernelEntry)
|
|
||||||
host.Ipmi = new(node.IpmiEntry)
|
|
||||||
var idEntry node.Entry
|
|
||||||
hostname, _ := os.Hostname()
|
hostname, _ := os.Hostname()
|
||||||
|
host.Id.Set(hostname)
|
||||||
|
|
||||||
wwlog.Info("Building overlay for %s: host", hostname)
|
wwlog.Info("Building overlay for %s: host", hostname)
|
||||||
idEntry.Set(hostname)
|
|
||||||
host.Id = idEntry
|
|
||||||
hostdir := OverlaySourceDir("host")
|
hostdir := OverlaySourceDir("host")
|
||||||
stats, err := os.Stat(hostdir)
|
stats, err := os.Stat(hostdir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user