Added controllers, services, and lots of various optimizations and fixes
This commit is contained in:
@@ -21,11 +21,11 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
nodeList, err := nodeDB.SearchByNameList(args)
|
||||
|
||||
for _, n := range nodeList {
|
||||
if SetGroup != "" && SetGroup != n.GroupName.String() {
|
||||
wwlog.Printf(wwlog.DEBUG, "skipping node of different group: %s/%s\n", n.GroupName, n.Id)
|
||||
if SetGroup != "" && SetGroup != n.Gid.String() {
|
||||
wwlog.Printf(wwlog.DEBUG, "skipping node of different group: %s/%s\n", n.Gid, n.Id)
|
||||
continue
|
||||
}
|
||||
err := nodeDB.DelNode(n.GroupName.String(), n.Id.String())
|
||||
err := nodeDB.DelNode(n.Cid.Get(), n.Gid.Get(), n.Id.Get())
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
} else {
|
||||
|
||||
@@ -11,11 +11,13 @@ var (
|
||||
}
|
||||
SetForce string
|
||||
SetGroup string
|
||||
SetController string
|
||||
)
|
||||
|
||||
func init() {
|
||||
baseCmd.PersistentFlags().StringVarP(&SetForce, "force", "f", "", "Force node delete")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetGroup, "group", "g", "default", "Set group to delete nodes from")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetController, "controller", "c", "default", "Controller to add nodes to")
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user