Merge pull request #238 from gmkurtzer/network_refactor_backwardscompat_fix
Backwards compatibility fix for network config
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user