From b971ff263653bc7c2a03ca46997a298a33b7c94e Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Tue, 4 Jan 2022 02:15:21 +0000 Subject: [PATCH 1/2] Backwards compatibility fix for network config --- internal/pkg/node/constructors.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 8f2d6e7b..e2c12bd5 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -88,7 +88,11 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) { } n.NetDevs[devname].Name.Set(devname) - n.NetDevs[devname].Device.Set(netdev.Device) + if netdev.Device != "" { + n.NetDevs[devname].Device.Set(netdev.Device) + } else { + n.NetDevs[devname].Device.Set(devname) + } n.NetDevs[devname].Ipaddr.Set(netdev.Ipaddr) n.NetDevs[devname].Netmask.Set(netdev.Netmask) n.NetDevs[devname].Hwaddr.Set(netdev.Hwaddr) From 5602fb0177a52f6bc51dd3a947b53fb4d0052bc9 Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Tue, 4 Jan 2022 02:20:06 +0000 Subject: [PATCH 2/2] Minor fixup for not setting onboot to be true via Cobra This is already done more robustly within the code --- internal/app/wwctl/node/set/root.go | 2 +- internal/app/wwctl/profile/set/root.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/app/wwctl/node/set/root.go b/internal/app/wwctl/node/set/root.go index f8885462..c763b84f 100644 --- a/internal/app/wwctl/node/set/root.go +++ b/internal/app/wwctl/node/set/root.go @@ -136,7 +136,7 @@ func init() { baseCmd.PersistentFlags().StringVarP(&SetGateway, "gateway", "G", "", "Set the node's network device gateway") baseCmd.PersistentFlags().StringVarP(&SetHwaddr, "hwaddr", "H", "", "Set the node's network device HW address") baseCmd.PersistentFlags().StringVarP(&SetType, "type", "T", "", "Set the node's network device type") - baseCmd.PersistentFlags().StringVar(&SetNetOnBoot, "onboot", "yes", "Enable/disable device (yes/no)") + baseCmd.PersistentFlags().StringVar(&SetNetOnBoot, "onboot", "", "Enable/disable device (yes/no)") baseCmd.PersistentFlags().BoolVar(&SetNetDevDel, "netdel", false, "Delete the node's network device") diff --git a/internal/app/wwctl/profile/set/root.go b/internal/app/wwctl/profile/set/root.go index 270f01a1..88ae5293 100644 --- a/internal/app/wwctl/profile/set/root.go +++ b/internal/app/wwctl/profile/set/root.go @@ -119,7 +119,7 @@ func init() { baseCmd.PersistentFlags().StringVarP(&SetGateway, "gateway", "G", "", "Set the node's network device gateway") baseCmd.PersistentFlags().StringVarP(&SetHwaddr, "hwaddr", "H", "", "Set the node's network device HW address") baseCmd.PersistentFlags().StringVarP(&SetType, "type", "T", "", "Set the node's network device type") - baseCmd.PersistentFlags().StringVar(&SetNetOnBoot, "onboot", "yes", "Enable/disable device (yes/no)") + baseCmd.PersistentFlags().StringVar(&SetNetOnBoot, "onboot", "", "Enable/disable device (yes/no)") baseCmd.PersistentFlags().BoolVar(&SetNetDevDel, "netdel", false, "Delete the node's network device")