Rename BaseConf.New to BaseConf.Get
Since BaseConf.New could return a cached BaseConf, rather than always constructing a new struct, I've renamed it to Get to more accurately reflect its use. A new New() method is called by Get and always initializes a new struct. Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
@@ -17,7 +17,7 @@ dhcp configuration is checked.
|
||||
*/
|
||||
func Dhcp() (err error) {
|
||||
|
||||
controller := warewulfconf.New()
|
||||
controller := warewulfconf.Get()
|
||||
|
||||
if !controller.Dhcp.Enabled {
|
||||
wwlog.Info("This system is not configured as a Warewulf DHCP controller")
|
||||
|
||||
@@ -16,7 +16,7 @@ nfs server.
|
||||
*/
|
||||
func NFS() error {
|
||||
|
||||
controller := warewulfconf.New()
|
||||
controller := warewulfconf.Get()
|
||||
|
||||
if controller.Nfs.Enabled {
|
||||
if controller.Warewulf.EnableHostOverlay {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
func SSH() error {
|
||||
if os.Getuid() == 0 {
|
||||
fmt.Printf("Updating system keys\n")
|
||||
conf := warewulfconf.New()
|
||||
conf := warewulfconf.Get()
|
||||
wwkeydir := path.Join(conf.Paths.Sysconfdir, "warewulf/keys") + "/"
|
||||
|
||||
err := os.MkdirAll(path.Join(conf.Paths.Sysconfdir, "warewulf/keys"), 0755)
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func TFTP() error {
|
||||
controller := warewulfconf.New()
|
||||
controller := warewulfconf.Get()
|
||||
var tftpdir string = path.Join(controller.Paths.Tftpdir, "warewulf")
|
||||
|
||||
err := os.MkdirAll(tftpdir, 0755)
|
||||
|
||||
Reference in New Issue
Block a user