Remove trailing newline from wwlog
I noticed that some wwlog calls included a trailing newline, but others did not. I tested both in isolation and discovered that the behavior was consistent regardless of whether a trailing newline was included. I further confirmed in code that wwlog appends a trailing newline automatically if it is not present; so a trailing newline is unnecessary in individual calls. This commit removes trailing newlines from all calls to make them consistent. It also replaces two calls to wwlog.Printf. (see #534) Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
@@ -40,34 +40,34 @@ func ContainerBuild(cbp *wwapiv1.ContainerBuildParameter) (err error) {
|
||||
for _, c := range containers {
|
||||
if !container.ValidSource(c) {
|
||||
err = fmt.Errorf("VNFS name does not exist: %s", c)
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
err = container.Build(c, cbp.Force)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not build container %s: %s\n", c, err)
|
||||
wwlog.Error("Could not build container %s: %s", c, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if cbp.Default {
|
||||
if len(containers) != 1 {
|
||||
wwlog.Error("Can only set default for one container\n")
|
||||
wwlog.Error("Can only set default for one container")
|
||||
} else {
|
||||
var nodeDB node.NodeYaml
|
||||
nodeDB, err = node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not open node configuration: %s\n", err)
|
||||
wwlog.Error("Could not open node configuration: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
//TODO: Don't loop through profiles, instead have a nodeDB function that goes directly to the map
|
||||
profiles, _ := nodeDB.FindAllProfiles()
|
||||
for _, profile := range profiles {
|
||||
wwlog.Debug("Looking for profile default: %s\n", profile.Id.Get())
|
||||
wwlog.Debug("Looking for profile default: %s", profile.Id.Get())
|
||||
if profile.Id.Get() == "default" {
|
||||
wwlog.Debug("Found profile default, setting container name to: %s\n", containers[0])
|
||||
wwlog.Debug("Found profile default, setting container name to: %s", containers[0])
|
||||
profile.ContainerName.Set(containers[0])
|
||||
err := nodeDB.ProfileUpdate(profile)
|
||||
if err != nil {
|
||||
@@ -94,7 +94,7 @@ func ContainerDelete(cdp *wwapiv1.ContainerDeleteParameter) (err error) {
|
||||
|
||||
nodeDB, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not open nodeDB: %s\n", err)
|
||||
wwlog.Error("Could not open nodeDB: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -109,18 +109,18 @@ ARG_LOOP:
|
||||
containerName := cdp.ContainerNames[i]
|
||||
for _, n := range nodes {
|
||||
if n.ContainerName.Get() == containerName {
|
||||
wwlog.Error("Container is configured for nodes, skipping: %s\n", containerName)
|
||||
wwlog.Error("Container is configured for nodes, skipping: %s", containerName)
|
||||
continue ARG_LOOP
|
||||
}
|
||||
}
|
||||
|
||||
if !container.ValidSource(containerName) {
|
||||
wwlog.Error("Container name is not a valid source: %s\n", containerName)
|
||||
wwlog.Error("Container name is not a valid source: %s", containerName)
|
||||
continue
|
||||
}
|
||||
err := container.DeleteSource(containerName)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not remove source: %s\n", containerName)
|
||||
wwlog.Error("Could not remove source: %s", containerName)
|
||||
} else {
|
||||
fmt.Printf("Container has been deleted: %s\n", containerName)
|
||||
}
|
||||
@@ -143,7 +143,7 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin
|
||||
}
|
||||
if !container.ValidName(cip.Name) {
|
||||
err = fmt.Errorf("VNFS name contains illegal characters: %s", cip.Name)
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -155,53 +155,53 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin
|
||||
fmt.Printf("Overwriting existing VNFS\n")
|
||||
err = os.RemoveAll(fullPath)
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
} else if cip.Update {
|
||||
fmt.Printf("Updating existing VNFS\n")
|
||||
} else {
|
||||
err = fmt.Errorf("VNFS Name exists, specify --force, --update, or choose a different name: %s", cip.Name)
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
} else if strings.HasPrefix(cip.Source, "docker://") || strings.HasPrefix(cip.Source, "docker-daemon://") {
|
||||
var sCtx *types.SystemContext
|
||||
sCtx, err = getSystemContext()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
// return was missing here. Was that deliberate?
|
||||
}
|
||||
|
||||
err = container.ImportDocker(cip.Source, cip.Name, sCtx)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not import image: %s\n", err)
|
||||
wwlog.Error("Could not import image: %s", err)
|
||||
_ = container.DeleteSource(cip.Name)
|
||||
return
|
||||
}
|
||||
} else if util.IsDir(cip.Source) {
|
||||
err = container.ImportDirectory(cip.Source, cip.Name)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not import image: %s\n", err)
|
||||
wwlog.Error("Could not import image: %s", err)
|
||||
_ = container.DeleteSource(cip.Name)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
err = fmt.Errorf("Invalid dir or uri: %s", cip.Source)
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("Updating the container's /etc/resolv.conf\n")
|
||||
err = util.CopyFile("/etc/resolv.conf", path.Join(container.RootFsDir(cip.Name), "/etc/resolv.conf"))
|
||||
if err != nil {
|
||||
wwlog.Warn("Could not copy /etc/resolv.conf into container: %s\n", err)
|
||||
wwlog.Warn("Could not copy /etc/resolv.conf into container: %s", err)
|
||||
}
|
||||
|
||||
fmt.Printf("Building container: %s\n", cip.Name)
|
||||
err = container.Build(cip.Name, true)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not build container %s: %s\n", cip.Name, err)
|
||||
wwlog.Error("Could not build container %s: %s", cip.Name, err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -209,16 +209,16 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin
|
||||
var nodeDB node.NodeYaml
|
||||
nodeDB, err = node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not open node configuration: %s\n", err)
|
||||
wwlog.Error("Could not open node configuration: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
//TODO: Don't loop through profiles, instead have a nodeDB function that goes directly to the map
|
||||
profiles, _ := nodeDB.FindAllProfiles()
|
||||
for _, profile := range profiles {
|
||||
wwlog.Debug("Looking for profile default: %s\n", profile.Id.Get())
|
||||
wwlog.Debug("Looking for profile default: %s", profile.Id.Get())
|
||||
if profile.Id.Get() == "default" {
|
||||
wwlog.Debug("Found profile default, setting container name to: %s\n", cip.Name)
|
||||
wwlog.Debug("Found profile default, setting container name to: %s", cip.Name)
|
||||
profile.ContainerName.Set(cip.Name)
|
||||
err = nodeDB.ProfileUpdate(profile)
|
||||
if err != nil {
|
||||
@@ -251,19 +251,19 @@ func ContainerList() (containerInfo []*wwapiv1.ContainerInfo, err error) {
|
||||
|
||||
sources, err = container.ListSources()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
nodeDB, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
nodes, err := nodeDB.FindAllNodes()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ func ContainerList() (containerInfo []*wwapiv1.ContainerInfo, err error) {
|
||||
nodemap[source] = 0
|
||||
}
|
||||
|
||||
wwlog.Debug("Finding kernel version for: %s\n", source)
|
||||
wwlog.Debug("Finding kernel version for: %s", source)
|
||||
kernelVersion := container.KernelVersion(source)
|
||||
|
||||
containerInfo = append(containerInfo, &wwapiv1.ContainerInfo{
|
||||
|
||||
@@ -38,34 +38,34 @@ func ContainerBuild(cbp *wwapiv1.ContainerBuildParameter) (err error) {
|
||||
for _, c := range containers {
|
||||
if !container.ValidSource(c) {
|
||||
err = fmt.Errorf("VNFS name does not exist: %s", c)
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
err = container.Build(c, cbp.Force)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not build container %s: %s\n", c, err)
|
||||
wwlog.Error("Could not build container %s: %s", c, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if cbp.Default {
|
||||
if len(containers) != 1 {
|
||||
wwlog.Error("Can only set default for one container\n")
|
||||
wwlog.Error("Can only set default for one container")
|
||||
} else {
|
||||
var nodeDB node.NodeYaml
|
||||
nodeDB, err = node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not open node configuration: %s\n", err)
|
||||
wwlog.Error("Could not open node configuration: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
//TODO: Don't loop through profiles, instead have a nodeDB function that goes directly to the map
|
||||
profiles, _ := nodeDB.FindAllProfiles()
|
||||
for _, profile := range profiles {
|
||||
wwlog.Debug("Looking for profile default: %s\n", profile.Id.Get())
|
||||
wwlog.Debug("Looking for profile default: %s", profile.Id.Get())
|
||||
if profile.Id.Get() == "default" {
|
||||
wwlog.Debug("Found profile default, setting container name to: %s\n", containers[0])
|
||||
wwlog.Debug("Found profile default, setting container name to: %s", containers[0])
|
||||
profile.ContainerName.Set(containers[0])
|
||||
err := nodeDB.ProfileUpdate(profile)
|
||||
if err != nil {
|
||||
@@ -92,7 +92,7 @@ func ContainerDelete(cdp *wwapiv1.ContainerDeleteParameter) (err error) {
|
||||
|
||||
nodeDB, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not open nodeDB: %s\n", err)
|
||||
wwlog.Error("Could not open nodeDB: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -107,22 +107,22 @@ ARG_LOOP:
|
||||
containerName := cdp.ContainerNames[i]
|
||||
for _, n := range nodes {
|
||||
if n.ContainerName.Get() == containerName {
|
||||
wwlog.Error("Container is configured for nodes, skipping: %s\n", containerName)
|
||||
wwlog.Error("Container is configured for nodes, skipping: %s", containerName)
|
||||
continue ARG_LOOP
|
||||
}
|
||||
}
|
||||
|
||||
if !container.ValidSource(containerName) {
|
||||
wwlog.Error("Container name is not a valid source: %s\n", containerName)
|
||||
wwlog.Error("Container name is not a valid source: %s", containerName)
|
||||
continue
|
||||
}
|
||||
err := container.DeleteSource(containerName)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not remove source: %s\n", containerName)
|
||||
wwlog.Error("Could not remove source: %s", containerName)
|
||||
}
|
||||
err = container.DeleteImage(containerName)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not remove image files %s\n", containerName)
|
||||
wwlog.Error("Could not remove image files %s", containerName)
|
||||
}
|
||||
|
||||
fmt.Printf("Container has been deleted: %s\n", containerName)
|
||||
@@ -200,7 +200,7 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin
|
||||
wwlog.Info("Updating the container's /etc/resolv.conf")
|
||||
err = util.CopyFile("/etc/resolv.conf", path.Join(container.RootFsDir(cip.Name), "/etc/resolv.conf"))
|
||||
if err != nil {
|
||||
wwlog.Warn("Could not copy /etc/resolv.conf into container: %s\n", err)
|
||||
wwlog.Warn("Could not copy /etc/resolv.conf into container: %s", err)
|
||||
}
|
||||
|
||||
err = container.SyncUids(cip.Name, !cip.SyncUser)
|
||||
@@ -265,19 +265,19 @@ func ContainerList() (containerInfo []*wwapiv1.ContainerInfo, err error) {
|
||||
|
||||
sources, err = container.ListSources()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
nodeDB, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
nodes, err := nodeDB.FindAllNodes()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ func ContainerList() (containerInfo []*wwapiv1.ContainerInfo, err error) {
|
||||
nodemap[source] = 0
|
||||
}
|
||||
|
||||
wwlog.Debug("Finding kernel version for: %s\n", source)
|
||||
wwlog.Debug("Finding kernel version for: %s", source)
|
||||
kernelVersion := container.KernelVersion(source)
|
||||
|
||||
containerInfo = append(containerInfo, &wwapiv1.ContainerInfo{
|
||||
|
||||
@@ -43,7 +43,7 @@ func NodeAdd(nap *wwapiv1.NodeAddParameter) (err error) {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to add node")
|
||||
}
|
||||
wwlog.Info("Added node: %s\n", a)
|
||||
wwlog.Info("Added node: %s", a)
|
||||
var netName string
|
||||
for netName = range nodeConf.NetDevs {
|
||||
// as map should only have key this should give is the first and
|
||||
@@ -55,12 +55,12 @@ func NodeAdd(nap *wwapiv1.NodeAddParameter) (err error) {
|
||||
// if more nodes are added increment IPv4 address
|
||||
nodeConf.NetDevs[netName].Ipaddr = util.IncrementIPv4(nodeConf.NetDevs[netName].Ipaddr, 1)
|
||||
|
||||
wwlog.Verbose("Incremented IP addr to %s\n", nodeConf.NetDevs[netName].Ipaddr)
|
||||
wwlog.Verbose("Incremented IP addr to %s", nodeConf.NetDevs[netName].Ipaddr)
|
||||
}
|
||||
if nodeConf.Ipmi != nil && nodeConf.Ipmi.Ipaddr != "" {
|
||||
// if more nodes are added increment IPv4 address
|
||||
nodeConf.Ipmi.Ipaddr = util.IncrementIPv4(nodeConf.Ipmi.Ipaddr, 1)
|
||||
wwlog.Verbose("Incremented IP addr to %s\n", nodeConf.Ipmi.Ipaddr)
|
||||
wwlog.Verbose("Incremented IP addr to %s", nodeConf.Ipmi.Ipaddr)
|
||||
}
|
||||
err = nodeDB.NodeUpdate(n)
|
||||
if err != nil {
|
||||
@@ -92,14 +92,14 @@ func NodeDelete(ndp *wwapiv1.NodeDeleteParameter) (err error) {
|
||||
|
||||
nodeDB, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Failed to open node database: %s\n", err)
|
||||
wwlog.Error("Failed to open node database: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
for _, n := range nodeList {
|
||||
err := nodeDB.DelNode(n.Id.Get())
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
} else {
|
||||
//count++
|
||||
fmt.Printf("Deleting node: %s\n", n.Id.Print())
|
||||
@@ -130,13 +130,13 @@ func NodeDeleteParameterCheck(ndp *wwapiv1.NodeDeleteParameter, console bool) (n
|
||||
|
||||
nodeDB, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Failed to open node database: %s\n", err)
|
||||
wwlog.Error("Failed to open node database: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
nodes, err := nodeDB.FindAllNodes()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not get node list: %s\n", err)
|
||||
wwlog.Error("Could not get node list: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -201,13 +201,13 @@ func NodeSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (nodeDB
|
||||
|
||||
nodeDB, err = node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not open node configuration: %s\n", err)
|
||||
wwlog.Error("Could not open node configuration: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
nodes, err := nodeDB.FindAllNodes()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not get node list: %s\n", err)
|
||||
wwlog.Error("Could not get node list: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -229,22 +229,22 @@ func NodeSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (nodeDB
|
||||
}
|
||||
|
||||
for _, n := range nodes {
|
||||
wwlog.Verbose("Evaluating node: %s\n", n.Id.Get())
|
||||
wwlog.Verbose("Evaluating node: %s", n.Id.Get())
|
||||
var nodeConf node.NodeConf
|
||||
err = yaml.Unmarshal([]byte(set.NodeConfYaml), &nodeConf)
|
||||
if err != nil {
|
||||
wwlog.Error(fmt.Sprintf("%v\n", err.Error()))
|
||||
wwlog.Error(fmt.Sprintf("%v", err.Error()))
|
||||
return
|
||||
}
|
||||
n.SetFrom(&nodeConf)
|
||||
if set.NetdevDelete != "" {
|
||||
if _, ok := n.NetDevs[set.NetdevDelete]; !ok {
|
||||
err = fmt.Errorf("network device name doesn't exist: %s", set.NetdevDelete)
|
||||
wwlog.Error(fmt.Sprintf("%v\n", err.Error()))
|
||||
wwlog.Error(fmt.Sprintf("%v", err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
wwlog.Verbose("Node: %s, Deleting network device: %s\n", n.Id.Get(), set.NetdevDelete)
|
||||
wwlog.Verbose("Node: %s, Deleting network device: %s", n.Id.Get(), set.NetdevDelete)
|
||||
delete(n.NetDevs, set.NetdevDelete)
|
||||
}
|
||||
for _, key := range nodeConf.TagsDel {
|
||||
@@ -262,7 +262,7 @@ func NodeSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (nodeDB
|
||||
}
|
||||
err := nodeDB.NodeUpdate(n)
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -292,22 +292,22 @@ func NodeStatus(nodeNames []string) (nodeStatusResponse *wwapiv1.NodeStatusRespo
|
||||
|
||||
controller, err := warewulfconf.New()
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
if controller.Ipaddr == "" {
|
||||
err = fmt.Errorf("the Warewulf Server IP Address is not properly configured")
|
||||
wwlog.Error(fmt.Sprintf("%v\n", err.Error()))
|
||||
wwlog.Error(fmt.Sprintf("%v", err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
statusURL := fmt.Sprintf("http://%s:%d/status", controller.Ipaddr, controller.Warewulf.Port)
|
||||
wwlog.Verbose("Connecting to: %s\n", statusURL)
|
||||
wwlog.Verbose("Connecting to: %s", statusURL)
|
||||
|
||||
resp, err := http.Get(statusURL)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not connect to Warewulf server: %s\n", err)
|
||||
wwlog.Error("Could not connect to Warewulf server: %s", err)
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
@@ -317,7 +317,7 @@ func NodeStatus(nodeNames []string) (nodeStatusResponse *wwapiv1.NodeStatusRespo
|
||||
|
||||
err = decoder.Decode(&wwNodeStatus)
|
||||
if err != nil {
|
||||
wwlog.Error("Could not decode JSON: %s\n", err)
|
||||
wwlog.Error("Could not decode JSON: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -51,13 +51,13 @@ func ProfileSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (node
|
||||
|
||||
nodeDB, err = node.New()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not open configuration: %s\n", err)
|
||||
wwlog.Error("Could not open configuration: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
profiles, err := nodeDB.FindAllProfiles()
|
||||
if err != nil {
|
||||
wwlog.Error("Could not get profile list: %s\n", err)
|
||||
wwlog.Error("Could not get profile list: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -78,21 +78,21 @@ func ProfileSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (node
|
||||
var pConf node.NodeConf
|
||||
err = yaml.Unmarshal([]byte(set.NodeConfYaml), &pConf)
|
||||
if err != nil {
|
||||
wwlog.Error(fmt.Sprintf("%v\n", err.Error()))
|
||||
wwlog.Error(fmt.Sprintf("%v", err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
for _, p := range profiles {
|
||||
if util.InSlice(set.NodeNames, p.Id.Get()) {
|
||||
wwlog.Verbose("Evaluating profile: %s\n", p.Id.Get())
|
||||
wwlog.Verbose("Evaluating profile: %s", p.Id.Get())
|
||||
p.SetFrom(&pConf)
|
||||
if set.NetdevDelete != "" {
|
||||
if _, ok := p.NetDevs[set.NetdevDelete]; !ok {
|
||||
err = fmt.Errorf("network device name doesn't exist: %s", set.NetdevDelete)
|
||||
wwlog.Error(fmt.Sprintf("%v\n", err.Error()))
|
||||
wwlog.Error(fmt.Sprintf("%v", err.Error()))
|
||||
return
|
||||
}
|
||||
wwlog.Verbose("Profile: %s, Deleting network device: %s\n", p.Id.Get(), set.NetdevDelete)
|
||||
wwlog.Verbose("Profile: %s, Deleting network device: %s", p.Id.Get(), set.NetdevDelete)
|
||||
delete(p.NetDevs, set.NetdevDelete)
|
||||
}
|
||||
for _, key := range pConf.TagsDel {
|
||||
@@ -110,7 +110,7 @@ func ProfileSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (node
|
||||
}
|
||||
err := nodeDB.ProfileUpdate(p)
|
||||
if err != nil {
|
||||
wwlog.Error("%s\n", err)
|
||||
wwlog.Error("%s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user