Audit and correct documentation, cobra help text, and log messages for accuracy

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2026-03-18 16:58:39 -06:00
parent 7d56252d65
commit 9e526c23fc
23 changed files with 50 additions and 43 deletions

View File

@@ -101,13 +101,13 @@ func (of *OverlayFile) readContents() (string, error) {
fullPath := of.FullPath()
f, err := os.ReadFile(fullPath)
if err != nil {
wwlog.Warn("os.ReadFile err %w", err)
wwlog.Warn("os.ReadFile err %v", err)
return "", err
}
// Populate the permissions, uid, and gid.
s, err := os.Stat(fullPath)
if err != nil {
wwlog.Warn("os.Stat err %w", err)
wwlog.Warn("os.Stat err %v", err)
return "", err
}
fileMode := s.Mode()

View File

@@ -82,7 +82,7 @@ func DaemonStatus() error {
} else {
err := process.Signal(syscall.Signal(0))
if err != nil {
return fmt.Errorf("failed to send process SIGCONT: %w", err)
return fmt.Errorf("failed to send signal 0 (process existence check): %w", err)
} else {
wwlog.Serv("Warewulf server is running at PID: %d", pid)
}

View File

@@ -6,6 +6,7 @@ import (
"path"
"github.com/warewulf/warewulf/internal/pkg/image"
"github.com/warewulf/warewulf/internal/pkg/util"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
@@ -38,20 +39,20 @@ func HandleEfiBoot(w http.ResponseWriter, req *http.Request) {
case "grub.efi", "grub-tpm.efi", "grubx64.efi", "grubia32.efi", "grubaa64.efi", "grubarm.efi":
stageFile = image.GrubFind(imageName)
if stageFile == "" {
wwlog.Error("could't find grub*.efi for %s", imageName)
wwlog.Error("couldn't find grub*.efi for %s", imageName)
w.WriteHeader(http.StatusNotFound)
return
}
case "grub.cfg":
stageFile = path.Join(ctx.conf.Paths.Sysconfdir, "warewulf/grub/grub.cfg.ww")
tmplData = buildTemplateVars(ctx.conf, ctx.rinfo, ctx.remoteNode)
if stageFile == "" {
wwlog.Error("could't find grub.cfg template for %s", imageName)
if !util.IsFile(stageFile) {
wwlog.Error("couldn't find grub.cfg template for %s", imageName)
w.WriteHeader(http.StatusNotFound)
return
}
default:
wwlog.ErrorExc(fmt.Errorf("could't find efiboot file: %s", ctx.rinfo.efifile), "")
wwlog.ErrorExc(fmt.Errorf("couldn't find efiboot file: %s", ctx.rinfo.efifile), "")
w.WriteHeader(http.StatusNotFound)
return
}

View File

@@ -97,7 +97,7 @@ func RunServer() error {
auth := warewulfconf.NewAuthentication()
if util.IsFile(conf.Paths.AuthenticationConf()) {
if err := auth.Read(conf.Paths.AuthenticationConf()); err != nil {
wwlog.Warn("%w\n", err)
wwlog.Warn("%v", err)
}
}