removed getters as configs must exportable
Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
func OverlaySourceTopDir() string {
|
||||
conf := warewulfconf.New()
|
||||
return conf.WWOVERLAYDIR()
|
||||
return conf.Paths.WWOverlaydir
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -32,5 +32,5 @@ Returns the overlay name of the image for a given node
|
||||
*/
|
||||
func OverlayImage(nodeName string, overlayName []string) string {
|
||||
conf := warewulfconf.New()
|
||||
return path.Join(conf.WWPROVISIONDIR(), "overlays/", nodeName, strings.Join(overlayName, "-")+".img")
|
||||
return path.Join(conf.Paths.WWProvisiondir, "overlays/", nodeName, strings.Join(overlayName, "-")+".img")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user