Lots of updates with the node management CLI tools

This commit is contained in:
Gregory Kurtzer
2020-11-22 20:35:13 -08:00
parent 5181940952
commit 5cd1dc901e
18 changed files with 579 additions and 139 deletions

View File

@@ -14,7 +14,13 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
nodeDB.AddNode(args[0], args[1])
for _, a := range args {
err = nodeDB.AddNode(SetGroup, a)
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
}
}
nodeDB.Persist()

View File

@@ -8,6 +8,7 @@ var (
Short: "Add new node",
Long: "Add new node ",
RunE: CobraRunE,
Args: cobra.MinimumNArgs(1),
}
SetGroup string
)