removed duplicate SetType

This commit is contained in:
Niko Kivel
2021-05-08 19:12:49 +02:00
parent 37556e6a64
commit 7f625d7d02

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")