Moving warewulfd code around and implementing new API for config.*()

This commit is contained in:
Gregory Kurtzer
2020-11-11 22:16:24 -08:00
parent 9a9672a060
commit fa2a7e26d3
18 changed files with 140 additions and 447 deletions

View File

@@ -1,15 +1,12 @@
package vnfs
import (
"github.com/hpcng/warewulf/internal/pkg/config"
"path"
"strings"
)
type VnfsObject struct {
SourcePath string
RootPath string
ImagePath string
}
func New(s string) VnfsObject {
@@ -20,7 +17,6 @@ func New(s string) VnfsObject {
return ret
}
func (self *VnfsObject) Name() string {
if self.SourcePath == "" {
return ""
@@ -52,21 +48,4 @@ func (self *VnfsObject) Source() string {
}
return self.SourcePath
}
func (self *VnfsObject) Image() string {
if self.SourcePath == "" {
return ""
}
return config.LocalStateDir + "/provision/vnfs/" + self.NameClean() + ".img.gz"
}
func (self *VnfsObject) Root() string {
if self.SourcePath == "" {
return ""
}
return config.LocalStateDir + "/chroots/" + self.NameClean()
}
}