Cleanups and removing the legacy wwclient program code
This commit is contained in:
@@ -3,6 +3,7 @@ package assets
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hpcng/warewulf/internal/pkg/vnfs"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
@@ -137,13 +138,16 @@ func FindAllNodes() ([]NodeInfo, error) {
|
||||
n.Fqdn = node.Hostname
|
||||
}
|
||||
|
||||
if strings.HasPrefix(n.Vnfs, "docker://") {
|
||||
if b, _ := regexp.MatchString(`^[a-z\-]+://`, n.Vnfs); b == true {
|
||||
//if strings.HasPrefix(n.Vnfs, "docker://") {
|
||||
//TODO: This is a kludge and shouldn't be done here. We need to go back
|
||||
// and do this from a "vnfs" interface or package
|
||||
v := vnfs.New(n.Vnfs)
|
||||
n.VnfsDir = v.Root()
|
||||
} else {
|
||||
} else if strings.HasPrefix(n.Vnfs, "/"){
|
||||
n.VnfsDir = n.Vnfs
|
||||
} else {
|
||||
wwlog.Printf(wwlog.ERROR, "Configuration 'Vnfs' is invalid for node: %s\n", n.Fqdn)
|
||||
}
|
||||
|
||||
ret = append(ret, n)
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
// THIS IS NOT BEING USED YET AND IS THUS A WORK IN PROGRESS
|
||||
|
||||
const SysConfDir = "/etc/warewulf/"
|
||||
const LocalStateDir = "/var/warewulf"
|
||||
const (
|
||||
SysConfDir = "/etc/warewulf/"
|
||||
LocalStateDir = "/var/warewulf"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Port int `yaml:"warewulfd port", envconfig:"WAREWULFD_PORT"`
|
||||
|
||||
@@ -43,7 +43,7 @@ func (self *VnfsObject) NameClean() string {
|
||||
}
|
||||
uri := strings.Split(self.SourcePath, "://")
|
||||
|
||||
return strings.ReplaceAll(uri[1], "/", "_")
|
||||
return strings.ReplaceAll(uri[0]+":"+uri[1], "/", "_")
|
||||
}
|
||||
|
||||
func (self *VnfsObject) Source() string {
|
||||
|
||||
@@ -22,7 +22,12 @@ var (
|
||||
func SetLevel(level uint) {
|
||||
logLevel = level
|
||||
|
||||
log.SetFlags(0)
|
||||
if level == DEBUG {
|
||||
log.SetFlags(log.Lmicroseconds)
|
||||
} else {
|
||||
log.SetFlags(0)
|
||||
}
|
||||
|
||||
Printf(DEBUG, "Set log level to: %d\n", logLevel)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user