Fixing oddball network configuration parameters

This commit is contained in:
Gregory Kurtzer
2022-02-12 03:08:33 +00:00
parent b1b893861e
commit e6a3810d20
3 changed files with 8 additions and 22 deletions

View File

@@ -181,10 +181,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
n.NetDevs[SetNetName] = &nd
if SetNetDev == "" {
n.NetDevs[SetNetName].Device.Set(SetNetName)
}
}
}

View File

@@ -145,17 +145,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
if _, ok := p.NetDevs[SetNetName]; !ok {
var nd node.NetDevEntry
SetNetOnBoot = "yes"
if len(p.NetDevs) == 0 {
SetNetDefault = "yes"
}
p.NetDevs[SetNetName] = &nd
if SetNetDev == "" {
p.NetDevs[SetNetName].Device.Set(SetNetName)
}
}
}

View File

@@ -41,16 +41,16 @@ type NodeConf struct {
}
type NetDevs struct {
Type string
OnBoot string
Device string
Hwaddr string
Ipaddr string
Type string `yaml:"type,omitempty"`
OnBoot string `yaml:"onboot,omitempty"`
Device string `yaml:"device,omitempty"`
Hwaddr string `yaml:"hwaddr,omitempty"`
Ipaddr string `yaml:"ipaddr,omitempty"`
IpCIDR string `yaml:"ipcidr,omitempty"`
Prefix string `yaml:"prefix,omitempty"`
Netmask string
Gateway string `yaml:"gateway"`
Default string
Netmask string `yaml:"netmask,omitempty"`
Gateway string `yaml:"gateway,omitempty"`
Default string `yaml:"default,omitempty"`
}
/******