fixed deletion of network and deletion of tags
This commit is contained in:
@@ -15,15 +15,13 @@ import (
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
// remove the default network as the all network values are assigned
|
||||
// to this network
|
||||
if NetName != "" {
|
||||
netDev := *NodeConf.NetDevs["default"]
|
||||
NodeConf.NetDevs[NetName] = &netDev
|
||||
if NetName != "default" {
|
||||
NodeConf.NetDevs[NetName] = NodeConf.NetDevs["default"]
|
||||
delete(NodeConf.NetDevs, "default")
|
||||
|
||||
}
|
||||
buffer, err := yaml.Marshal(NodeConf)
|
||||
if err != nil {
|
||||
wwlog.Error("Cant marshall nodeInfo", err)
|
||||
wwlog.Error("Can't marshall nodeInfo", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
set := wwapiv1.NodeSetParameter{
|
||||
|
||||
@@ -44,7 +44,7 @@ func init() {
|
||||
NodeConf = node.NewConf()
|
||||
NodeConf.CreateFlags(baseCmd, []string{})
|
||||
baseCmd.PersistentFlags().StringVarP(&SetNetDevDel, "netdel", "D", "", "Delete the node's network device")
|
||||
baseCmd.PersistentFlags().StringVar(&NetName, "netname", "", "Set network name for network options")
|
||||
baseCmd.PersistentFlags().StringVar(&NetName, "netname", "default", "Set network name for network options")
|
||||
baseCmd.PersistentFlags().BoolVarP(&SetNodeAll, "all", "a", false, "Set all nodes")
|
||||
baseCmd.PersistentFlags().BoolVarP(&SetYes, "yes", "y", false, "Set 'yes' to all questions asked")
|
||||
baseCmd.PersistentFlags().BoolVarP(&SetForce, "force", "f", false, "Force configuration (even on error)")
|
||||
|
||||
Reference in New Issue
Block a user