aboutsummaryrefslogtreecommitdiff
path: root/pkg/machine
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-09-10 07:40:39 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-09-10 07:52:00 -0400
commit2c63b8439bbdc09203ea394ad2cf9352830861f0 (patch)
tree39b9d8d061bc248e4dbeb6445c2ad0c99b048ae1 /pkg/machine
parent2d8417d86a7edf11bce5527f311bb951a651d40e (diff)
downloadpodman-2c63b8439bbdc09203ea394ad2cf9352830861f0.tar.gz
podman-2c63b8439bbdc09203ea394ad2cf9352830861f0.tar.bz2
podman-2c63b8439bbdc09203ea394ad2cf9352830861f0.zip
Fix stutters
Podman adds an Error: to every error message. So starting an error message with "error" ends up being reported to the user as Error: error ... This patch removes the stutter. Also ioutil.ReadFile errors report the Path, so wrapping the err message with the path causes a stutter. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/machine')
-rw-r--r--pkg/machine/ignition.go2
-rw-r--r--pkg/machine/qemu/machine.go2
-rw-r--r--pkg/machine/wsl/machine.go2
-rw-r--r--pkg/machine/wsl/util_windows.go6
4 files changed, 6 insertions, 6 deletions
diff --git a/pkg/machine/ignition.go b/pkg/machine/ignition.go
index f4602cc95..366d10499 100644
--- a/pkg/machine/ignition.go
+++ b/pkg/machine/ignition.go
@@ -561,7 +561,7 @@ func getCerts(certsDir string, isDir bool) []File {
func prepareCertFile(path string, name string) (File, error) {
b, err := ioutil.ReadFile(path)
if err != nil {
- logrus.Warnf("Unable to read cert file %s", err.Error())
+ logrus.Warnf("Unable to read cert file %v", err)
return File{}, err
}
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index b59f07876..738cd74be 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -1187,7 +1187,7 @@ func (p *Provider) IsValidVMName(name string) (bool, error) {
func (p *Provider) CheckExclusiveActiveVM() (bool, string, error) {
vms, err := getVMInfos()
if err != nil {
- return false, "", fmt.Errorf("error checking VM active: %w", err)
+ return false, "", fmt.Errorf("checking VM active: %w", err)
}
for _, vm := range vms {
if vm.Running || vm.Starting {
diff --git a/pkg/machine/wsl/machine.go b/pkg/machine/wsl/machine.go
index 7e453823f..44b82b823 100644
--- a/pkg/machine/wsl/machine.go
+++ b/pkg/machine/wsl/machine.go
@@ -939,7 +939,7 @@ func (v *MachineVM) Set(_ string, opts machine.SetOptions) ([]error, error) {
if opts.Rootful != nil && v.Rootful != *opts.Rootful {
err := v.setRootful(*opts.Rootful)
if err != nil {
- setErrors = append(setErrors, fmt.Errorf("error setting rootful option: %w", err))
+ setErrors = append(setErrors, fmt.Errorf("setting rootful option: %w", err))
} else {
v.Rootful = *opts.Rootful
}
diff --git a/pkg/machine/wsl/util_windows.go b/pkg/machine/wsl/util_windows.go
index 6613bde1f..67d1bfc5c 100644
--- a/pkg/machine/wsl/util_windows.go
+++ b/pkg/machine/wsl/util_windows.go
@@ -263,19 +263,19 @@ func obtainShutdownPrivilege() error {
var hToken uintptr
if ret, _, err := OpenProcessToken.Call(uintptr(proc), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, uintptr(unsafe.Pointer(&hToken))); ret != 1 {
- return fmt.Errorf("error opening process token: %w", err)
+ return fmt.Errorf("opening process token: %w", err)
}
var privs TokenPrivileges
if ret, _, err := LookupPrivilegeValue.Call(uintptr(0), uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(SeShutdownName))), uintptr(unsafe.Pointer(&(privs.privileges[0].luid)))); ret != 1 {
- return fmt.Errorf("error looking up shutdown privilege: %w", err)
+ return fmt.Errorf("looking up shutdown privilege: %w", err)
}
privs.privilegeCount = 1
privs.privileges[0].attributes = SE_PRIVILEGE_ENABLED
if ret, _, err := AdjustTokenPrivileges.Call(hToken, 0, uintptr(unsafe.Pointer(&privs)), 0, uintptr(0), 0); ret != 1 {
- return fmt.Errorf("error enabling shutdown privilege on token: %w", err)
+ return fmt.Errorf("enabling shutdown privilege on token: %w", err)
}
return nil