Renamed vnfs to container, finished VNFS and kernel refactoring
This commit is contained in:
@@ -2,9 +2,9 @@ package set
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hpcng/warewulf/internal/pkg/container"
|
||||
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/util"
|
||||
"github.com/hpcng/warewulf/internal/pkg/vnfs"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
"github.com/manifoldco/promptui"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -48,17 +48,17 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if SetVnfs != "" {
|
||||
if vnfs.ValidSource(SetVnfs) == true {
|
||||
imageFile := vnfs.ImageFile(SetVnfs)
|
||||
if SetContainer != "" {
|
||||
if container.ValidSource(SetContainer) == true {
|
||||
imageFile := container.ImageFile(SetContainer)
|
||||
if util.IsFile(imageFile) == false {
|
||||
wwlog.Printf(wwlog.ERROR, "VNFS has not been built: %s\n", SetVnfs)
|
||||
wwlog.Printf(wwlog.ERROR, "Container has not been built: %s\n", SetContainer)
|
||||
if SetForce == false {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wwlog.Printf(wwlog.ERROR, "VNFS does not exist: %s\n", SetVnfs)
|
||||
wwlog.Printf(wwlog.ERROR, "Container name does not exist: %s\n", SetContainer)
|
||||
if SetForce == false {
|
||||
os.Exit(1)
|
||||
}
|
||||
@@ -88,10 +88,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
if SetVnfs != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting VNFS to: %s\n", p.Id, SetVnfs)
|
||||
if SetContainer != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting Container name to: %s\n", p.Id, SetContainer)
|
||||
|
||||
p.Vnfs.Set(SetVnfs)
|
||||
p.ContainerName.Set(SetContainer)
|
||||
err := nodeDB.ProfileUpdate(p)
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
|
||||
Reference in New Issue
Block a user