Changed DomainName to ClusterName

This commit is contained in:
Gregory Kurtzer
2020-12-03 19:37:52 -08:00
parent f837422771
commit e80878b240
10 changed files with 24 additions and 22 deletions

View File

@@ -31,9 +31,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
sort.Slice(nodes, func(i, j int) bool {
if nodes[i].DomainName.Get() < nodes[j].DomainName.Get() {
if nodes[i].ClusterName.Get() < nodes[j].ClusterName.Get() {
return true
} else if nodes[i].DomainName.Get() == nodes[j].DomainName.Get() {
} else if nodes[i].ClusterName.Get() == nodes[j].ClusterName.Get() {
if nodes[i].Id.Get() < nodes[j].Id.Get() {
return true
}
@@ -47,7 +47,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
fmt.Printf("%-20s %-18s %-12s %s\n", "NODE", "FIELD", "PROFILE", "VALUE")
fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Id", node.Id.Source(), node.Id.Print())
fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Comment", node.Comment.Source(), node.Comment.Print())
fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "DomainName", node.DomainName.Source(), node.DomainName.Print())
fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "ClusterName", node.ClusterName.Source(), node.ClusterName.Print())
fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Profiles", "--", strings.Join(node.Profiles, ","))
fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Vnfs", node.Vnfs.Source(), node.Vnfs.Print())

View File

@@ -76,10 +76,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
}
if SetDomainName != "" {
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting domain name to: %s\n", n.Id.Get(), SetDomainName)
if SetClusterName != "" {
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting cluster name to: %s\n", n.Id.Get(), SetClusterName)
n.DomainName.Set(SetDomainName)
n.ClusterName.Set(SetClusterName)
err := nodeDB.NodeUpdate(n)
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)

View File

@@ -18,7 +18,7 @@ var (
SetGateway string
SetHwaddr string
SetNetDevDel bool
SetDomainName string
SetClusterName string
SetIpxe string
SetRuntimeOverlay string
SetSystemOverlay string
@@ -33,10 +33,10 @@ var (
)
func init() {
baseCmd.PersistentFlags().StringVarP(&SetComment, "comment", "C", "", "Set a comment for this node")
baseCmd.PersistentFlags().StringVar(&SetComment, "comment", "", "Set a comment for this node")
baseCmd.PersistentFlags().StringVarP(&SetVnfs, "vnfs", "V", "", "Set node Virtual Node File System (VNFS)")
baseCmd.PersistentFlags().StringVarP(&SetKernel, "kernel", "K", "", "Set Kernel version for nodes")
baseCmd.PersistentFlags().StringVarP(&SetDomainName, "domain", "D", "", "Set the node's domain name")
baseCmd.PersistentFlags().StringVarP(&SetClusterName, "cluster", "C", "", "Set the node's cluster name")
baseCmd.PersistentFlags().StringVarP(&SetIpxe, "ipxe", "P", "", "Set the node's iPXE template name")
baseCmd.PersistentFlags().StringVarP(&SetRuntimeOverlay, "runtime", "R", "", "Set the node's runtime overlay")
baseCmd.PersistentFlags().StringVarP(&SetSystemOverlay, "system", "S", "", "Set the node's system overlay")