Merge pull request #257 from gmkurtzer/various_relocation_fixes

Various relocation fixes
This commit is contained in:
Gregory M. Kurtzer
2022-01-25 19:59:32 -08:00
committed by GitHub
12 changed files with 21 additions and 20 deletions

View File

@@ -5,14 +5,18 @@ import (
"path"
"strings"
"github.com/hpcng/warewulf/internal/pkg/buildconfig"
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)
func templateFileInclude(path string) string {
wwlog.Printf(wwlog.DEBUG, "Including file into template: %s\n", path)
content, err := ioutil.ReadFile(path)
func templateFileInclude(inc string) string {
if !strings.HasPrefix(inc, "/") {
inc = path.Join(buildconfig.SYSCONFDIR(), "warewulf", inc)
}
wwlog.Printf(wwlog.DEBUG, "Including file into template: %s\n", inc)
content, err := ioutil.ReadFile(inc)
if err != nil {
wwlog.Printf(wwlog.VERBOSE, "Could not include file into template: %s\n", err)
}