removed getters as configs must exportable

Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
Christian Goll
2023-03-06 09:59:25 +01:00
parent b55473e1e4
commit ce43dfa0b7
17 changed files with 29 additions and 103 deletions

View File

@@ -15,9 +15,9 @@ func SSH() error {
if os.Getuid() == 0 {
fmt.Printf("Updating system keys\n")
conf := warewulfconf.New()
wwkeydir := path.Join(conf.SYSCONFDIR(), "warewulf/keys") + "/"
wwkeydir := path.Join(conf.Paths.Sysconfdir, "warewulf/keys") + "/"
err := os.MkdirAll(path.Join(conf.SYSCONFDIR(), "warewulf/keys"), 0755)
err := os.MkdirAll(path.Join(conf.Paths.Sysconfdir, "warewulf/keys"), 0755)
if err != nil {
wwlog.Error("Could not create base directory: %s", err)
os.Exit(1)

View File

@@ -12,7 +12,7 @@ import (
func TFTP() error {
controller := warewulfconf.New()
var tftpdir string = path.Join(controller.TFTPDIR(), "warewulf")
var tftpdir string = path.Join(controller.Paths.Tftpdir, "warewulf")
err := os.MkdirAll(tftpdir, 0755)
if err != nil {
@@ -27,7 +27,7 @@ func TFTP() error {
continue
}
copyCheck[f] = true
err = util.SafeCopyFile(path.Join(controller.DATADIR(), f), path.Join(tftpdir, f))
err = util.SafeCopyFile(path.Join(controller.Paths.Datadir, f), path.Join(tftpdir, f))
if err != nil {
wwlog.Warn("ipxe binary could not be copied, booting may not work: %s", err)
}