Remove useless "Disable" (ref #40)

This commit is contained in:
Gregory Kurtzer
2021-04-25 13:41:21 -07:00
parent 9d1a3bacfe
commit 5e53ff1b7d
4 changed files with 4 additions and 12 deletions

View File

@@ -31,7 +31,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
if ShowAll == true {
if ShowAll {
for _, node := range nodes {
fmt.Printf("################################################################################\n")
fmt.Printf("%-20s %-18s %-12s %s\n", "NODE", "FIELD", "PROFILE", "VALUE")
@@ -40,7 +40,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
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 %t\n", node.Id.Get(), "Disabled", node.Disabled.Source(), node.Disabled.PrintB())
fmt.Printf("%-20s %-18s %-12s %t\n", node.Id.Get(), "Discoverable", node.Discoverable.Source(), node.Discoverable.PrintB())
fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "ContainerName", node.ContainerName.Source(), node.ContainerName.Print())
@@ -73,7 +72,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
// }
}
} else if ShowNet == true {
} else if ShowNet {
fmt.Printf("%-22s %-6s %-18s %-15s %-15s\n", "NODE NAME", "DEVICE", "HWADDR", "IPADDR", "GATEWAY")
fmt.Println(strings.Repeat("=", 80))
@@ -87,7 +86,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
}
} else if ShowIpmi == true {
} else if ShowIpmi {
fmt.Printf("%-22s %-16s %-20s %-20s\n", "NODE NAME", "IPMI IPADDR", "IPMI USERNAME", "IPMI PASSWORD")
fmt.Println(strings.Repeat("=", 80))
@@ -95,7 +94,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
fmt.Printf("%-22s %-16s %-20s %-20s\n", node.Id.Get(), node.IpmiIpaddr.Print(), node.IpmiUserName.Print(), node.IpmiPassword.Print())
}
} else if ShowLong == true {
} else if ShowLong {
fmt.Printf("%-22s %-26s %-35s %s\n", "NODE NAME", "KERNEL VERSION", "CONTAINER", "OVERLAYS (S/R)")
fmt.Println(strings.Repeat("=", 120))

View File

@@ -80,7 +80,6 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) {
n.Root.Set(node.Root)
n.Discoverable.SetB(node.Discoverable)
n.Disabled.SetB(node.Disabled)
for devname, netdev := range node.NetDevs {
if _, ok := n.NetDevs[devname]; !ok {
@@ -120,7 +119,6 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) {
n.RuntimeOverlay.SetAlt(config.NodeProfiles[p].RuntimeOverlay, p)
n.Root.SetAlt(config.NodeProfiles[p].Root, p)
n.Disabled.SetAltB(config.NodeProfiles[p].Disabled, p)
n.Discoverable.SetAltB(config.NodeProfiles[p].Discoverable, p)
for devname, netdev := range config.NodeProfiles[p].NetDevs {
@@ -179,7 +177,6 @@ func (config *nodeYaml) FindAllProfiles() ([]NodeInfo, error) {
p.SystemOverlay.Set(profile.SystemOverlay)
p.Root.Set(profile.Root)
p.Disabled.SetB(profile.Disabled)
p.Discoverable.SetB(profile.Discoverable)
for devname, netdev := range profile.NetDevs {

View File

@@ -19,7 +19,6 @@ type nodeYaml struct {
type NodeConf struct {
Comment string `yaml:"comment,omitempty"`
Disabled bool `yaml:"disabled,omitempty"`
ClusterName string `yaml:"cluster name,omitempty"`
ContainerName string `yaml:"container name,omitempty"`
Ipxe string `yaml:"ipxe template,omitempty"`
@@ -79,7 +78,6 @@ type NodeInfo struct {
SystemOverlay Entry
Root Entry
Discoverable Entry
Disabled Entry
Init Entry //TODO: Finish adding this...
Profiles []string
GroupProfiles []string

View File

@@ -70,7 +70,6 @@ func (config *nodeYaml) NodeUpdate(node NodeInfo) error {
config.Nodes[nodeID].SystemOverlay = node.SystemOverlay.GetReal()
config.Nodes[nodeID].Root = node.Root.GetReal()
config.Nodes[nodeID].Disabled = node.Disabled.GetRealB()
config.Nodes[nodeID].Discoverable = node.Discoverable.GetRealB()
config.Nodes[nodeID].Profiles = node.Profiles
@@ -148,7 +147,6 @@ func (config *nodeYaml) ProfileUpdate(profile NodeInfo) error {
config.NodeProfiles[profileID].SystemOverlay = profile.SystemOverlay.GetReal()
config.NodeProfiles[profileID].Root = profile.Root.GetReal()
config.NodeProfiles[profileID].Disabled = profile.Disabled.GetRealB()
config.NodeProfiles[profileID].Discoverable = profile.Discoverable.GetRealB()
config.NodeProfiles[profileID].Profiles = profile.Profiles