Moving warewulfd code around and implementing new API for config.*()
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user