Add IpmiNetmask configuration

This commit is contained in:
Gregory Kurtzer
2020-12-01 18:03:22 -08:00
parent 37eaa979ec
commit 581bc929e0
11 changed files with 121 additions and 78 deletions

View File

@@ -126,6 +126,16 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
}
if SetIpmiNetmask != "" {
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting IPMI netmask to: %s\n", n.Fqdn, SetIpmiNetmask)
n.IpmiNetmask.Set(SetIpmiNetmask)
err := nodeDB.NodeUpdate(n)
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
}
}
if SetIpmiUsername != "" {
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting IPMI IP username to: %s\n", n.Fqdn, SetIpmiUsername)
@@ -170,8 +180,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
}
if SetNetDevDel == true {
if SetNetDev == "" {
wwlog.Printf(wwlog.ERROR, "You must include the '--netdev' option\n")
@@ -292,4 +300,4 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
return nil
}
}