Remove persist option from configure commands

This commit is contained in:
Gregory Kurtzer
2021-04-23 21:06:57 -07:00
parent d1bc747cc2
commit 19d4fec376
11 changed files with 42 additions and 51 deletions

View File

@@ -24,11 +24,6 @@ type dhcpTemplate struct {
}
func CobraRunE(cmd *cobra.Command, args []string) error {
if SetShow == false && SetPersist == false {
fmt.Println(cmd.Help())
os.Exit(0)
}
return Configure(SetShow)
}
@@ -58,7 +53,7 @@ func Configure(show bool) error {
os.Exit(1)
}
if controller.Dhcp.Enabled == false {
if !controller.Dhcp.Enabled {
wwlog.Printf(wwlog.INFO, "This system is not configured as a Warewulf DHCP controller\n")
os.Exit(1)
}
@@ -109,7 +104,7 @@ func Configure(show bool) error {
d.RangeStart = controller.Dhcp.RangeStart
d.RangeEnd = controller.Dhcp.RangeEnd
if show == false {
if !show {
fmt.Printf("Writing the DHCP configuration file\n")
configWriter, err := os.OpenFile(controller.Dhcp.ConfigFile, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0640)
if err != nil {