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 @@ Reads a file file from the host fs. If the file has nor '/' prefix
|
||||
the path is relative to Paths.SysconfdirTemplates in the file are no evaluated.
|
||||
*/
|
||||
func templateFileInclude(inc string) string {
|
||||
conf := warewulfconf.New()
|
||||
conf := warewulfconf.Get()
|
||||
if !strings.HasPrefix(inc, "/") {
|
||||
inc = path.Join(conf.Paths.Sysconfdir, "warewulf", inc)
|
||||
}
|
||||
@@ -35,7 +35,7 @@ is the file to read, the second the abort string
|
||||
Templates in the file are no evaluated.
|
||||
*/
|
||||
func templateFileBlock(inc string, abortStr string) (string, error) {
|
||||
conf := warewulfconf.New()
|
||||
conf := warewulfconf.Get()
|
||||
if !strings.HasPrefix(inc, "/") {
|
||||
inc = path.Join(conf.Paths.Sysconfdir, "warewulf", inc)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user