Merge pull request #79 from paulscherrerinstitute/duplicateSetType

LGTM, thanks!
This commit is contained in:
Gregory M. Kurtzer
2021-05-11 20:30:21 -07:00
committed by GitHub

View File

@@ -276,21 +276,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
n.NetDevs[SetNetDev].Hwaddr.Set(SetHwaddr)
}
if SetType != "" {
if SetNetDev == "" {
wwlog.Printf(wwlog.ERROR, "You must include the '--netdev' option\n")
os.Exit(1)
}
if _, ok := n.NetDevs[SetNetDev]; !ok {
var nd node.NetDevEntry
n.NetDevs[SetNetDev] = &nd
}
wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Setting HW address to: %s\n", n.Id.Get(), SetNetDev, SetType)
n.NetDevs[SetNetDev].Type.Set(SetType)
}
if SetType != "" {
if SetNetDev == "" {
wwlog.Printf(wwlog.ERROR, "You must include the '--netdev' option\n")