removed optionStrMap in favor of NodeConf

openStrMap is a map[string]string which is sent arround. This is now
done by using a unmarshalled NodeConf instead.
This commit is contained in:
Christian Goll
2022-08-17 16:41:20 +02:00
parent 2016588f36
commit b485ea999f
18 changed files with 1161 additions and 875 deletions

View File

@@ -36,18 +36,13 @@ var (
SetNodeAll bool
SetYes bool
SetForce bool
OptionStrMap map[string]*string
profileConf node.NodeConf
)
func init() {
// init empty helper structs, so that we know what's inside
myBase := node.CobraCommand{Command: baseCmd}
var emptyNodeConf node.NodeConf
emptyNodeConf.Kernel = new(node.KernelConf)
emptyNodeConf.Ipmi = new(node.IpmiConf)
OptionStrMap = myBase.CreateFlags(emptyNodeConf,
profileConf = node.NewConf()
profileConf.CreateFlags(baseCmd,
[]string{"ipaddr", "ipaddr6", "ipmiaddr", "profile"})
baseCmd.PersistentFlags().StringVarP(&SetNetDevDel, "netdel", "D", "", "Delete the node's network device")
baseCmd.PersistentFlags().BoolVarP(&SetNodeAll, "all", "a", false, "Set all nodes")
baseCmd.PersistentFlags().BoolVarP(&SetYes, "yes", "y", false, "Set 'yes' to all questions asked")