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

@@ -14,13 +14,12 @@ import (
/*
Reads a file file from the host fs. If the file has nor '/' prefix
the path is relative to SYSCONFDIR.
Templates in the file are no evaluated.
the path is relative to Paths.SysconfdirTemplates in the file are no evaluated.
*/
func templateFileInclude(inc string) string {
conf := warewulfconf.New()
if !strings.HasPrefix(inc, "/") {
inc = path.Join(conf.SYSCONFDIR(), "warewulf", inc)
inc = path.Join(conf.Paths.Sysconfdir, "warewulf", inc)
}
wwlog.Debug("Including file into template: %s", inc)
content, err := os.ReadFile(inc)
@@ -38,7 +37,7 @@ Templates in the file are no evaluated.
func templateFileBlock(inc string, abortStr string) (string, error) {
conf := warewulfconf.New()
if !strings.HasPrefix(inc, "/") {
inc = path.Join(conf.SYSCONFDIR(), "warewulf", inc)
inc = path.Join(conf.Paths.Sysconfdir, "warewulf", inc)
}
wwlog.Debug("Including file block into template: %s", inc)
readFile, err := os.Open(inc)