Only write to IPMI if this is explictly wanted
This commit is contained in:
@@ -136,6 +136,14 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
n.IpmiInterface.Set(SetIpmiInterface)
|
||||
}
|
||||
|
||||
if SetIpmiWrite == "yes" || SetNetOnBoot == "y" || SetNetOnBoot == "1" || SetNetOnBoot == "true" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting Ipmiwrite\n", n.Id.Get(), SetIpmiWrite)
|
||||
n.IpmiWrite.SetB(true)
|
||||
} else {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting Ipmiwrite \n", n.Id.Get(), SetIpmiWrite)
|
||||
n.IpmiWrite.SetB(false)
|
||||
}
|
||||
|
||||
if SetDiscoverable {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting node to discoverable\n", n.Id.Get())
|
||||
n.Discoverable.SetB(true)
|
||||
|
||||
@@ -58,6 +58,7 @@ var (
|
||||
SetIpmiUsername string
|
||||
SetIpmiPassword string
|
||||
SetIpmiInterface string
|
||||
SetIpmiWrite string
|
||||
SetNodeAll bool
|
||||
SetYes bool
|
||||
SetProfile string
|
||||
@@ -117,6 +118,7 @@ func init() {
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiUsername, "ipmiuser", "", "Set the node's IPMI username")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiPassword, "ipmipass", "", "Set the node's IPMI password")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiInterface, "ipmiinterface", "", "Set the node's IPMI interface (defaults: 'lan')")
|
||||
baseCmd.PersistentFlags().StringVar(&SetIpmiWrite, "ipmiwrite", "", "Enable/disable the write of impi configuration (yes/no)")
|
||||
baseCmd.PersistentFlags().StringSliceVar(&SetAddProfile, "addprofile", []string{}, "Add Profile(s) to node")
|
||||
baseCmd.PersistentFlags().StringSliceVar(&SetDelProfile, "delprofile", []string{}, "Remove Profile(s) to node")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetProfile, "profile", "P", "", "Set the node's profile members (comma separated)")
|
||||
|
||||
Reference in New Issue
Block a user