summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-03-25 08:19:39 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-03-25 21:47:04 -0400
commit7680211edefc32d97c6ec82062afa7a1ea00a001 (patch)
tree6892ea68e1c9ee8d247502a9f3ece19e70262989 /cmd/podman
parentdd2a28bfe623a722bb1126acf7c7148f7bb11847 (diff)
downloadpodman-7680211edefc32d97c6ec82062afa7a1ea00a001.tar.gz
podman-7680211edefc32d97c6ec82062afa7a1ea00a001.tar.bz2
podman-7680211edefc32d97c6ec82062afa7a1ea00a001.zip
Remove error stutter
When podman gets an error it prints out "Error: " before printing the error string. If the error message starts with error, we end up with Error: error ... This PR Removes all of these stutters. logrus.Error() also prints out that this is an error, so no need for the error stutter. [NO NEW TESTS NEEDED] Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/images/import.go4
-rw-r--r--cmd/podman/images/load.go4
-rw-r--r--cmd/podman/images/scp.go2
-rw-r--r--cmd/podman/inspect/inspect.go2
-rw-r--r--cmd/podman/pods/create.go2
-rw-r--r--cmd/podman/secrets/inspect.go2
-rw-r--r--cmd/podman/system/dial_stdio.go4
-rw-r--r--cmd/podman/utils/error.go2
8 files changed, 11 insertions, 11 deletions
diff --git a/cmd/podman/images/import.go b/cmd/podman/images/import.go
index 47f2a798d..1910fef6d 100644
--- a/cmd/podman/images/import.go
+++ b/cmd/podman/images/import.go
@@ -118,14 +118,14 @@ func importCon(cmd *cobra.Command, args []string) error {
if source == "-" {
outFile, err := ioutil.TempFile("", "podman")
if err != nil {
- return errors.Errorf("error creating file %v", err)
+ return errors.Errorf("creating file %v", err)
}
defer os.Remove(outFile.Name())
defer outFile.Close()
_, err = io.Copy(outFile, os.Stdin)
if err != nil {
- return errors.Errorf("error copying file %v", err)
+ return errors.Errorf("copying file %v", err)
}
source = outFile.Name()
}
diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go
index bbcfe93ce..30f88b02b 100644
--- a/cmd/podman/images/load.go
+++ b/cmd/podman/images/load.go
@@ -95,14 +95,14 @@ func load(cmd *cobra.Command, args []string) error {
}
outFile, err := ioutil.TempFile(util.Tmpdir(), "podman")
if err != nil {
- return errors.Errorf("error creating file %v", err)
+ return errors.Errorf("creating file %v", err)
}
defer os.Remove(outFile.Name())
defer outFile.Close()
_, err = io.Copy(outFile, os.Stdin)
if err != nil {
- return errors.Errorf("error copying file %v", err)
+ return errors.Errorf("copying file %v", err)
}
loadOpts.Input = outFile.Name()
}
diff --git a/cmd/podman/images/scp.go b/cmd/podman/images/scp.go
index 152275c68..51a9d1c4e 100644
--- a/cmd/podman/images/scp.go
+++ b/cmd/podman/images/scp.go
@@ -268,7 +268,7 @@ func saveToRemote(image, localFile string, tag string, uri *urlP.URL, iden strin
}
n, err := scpD.CopyFrom(dial, remoteFile, localFile)
if _, conErr := connection.ExecRemoteCommand(dial, "rm "+remoteFile); conErr != nil {
- logrus.Errorf("Error removing file on endpoint: %v", conErr)
+ logrus.Errorf("Removing file on endpoint: %v", conErr)
}
if err != nil {
errOut := strconv.Itoa(int(n)) + " Bytes copied before error"
diff --git a/cmd/podman/inspect/inspect.go b/cmd/podman/inspect/inspect.go
index ef8a06163..b26b2d667 100644
--- a/cmd/podman/inspect/inspect.go
+++ b/cmd/podman/inspect/inspect.go
@@ -231,7 +231,7 @@ func (i *inspector) inspect(namesOrIDs []string) error {
fmt.Fprintf(os.Stderr, "error inspecting object: %v\n", err)
}
}
- return errors.Errorf("error inspecting object: %v", errs[0])
+ return errors.Errorf("inspecting object: %v", errs[0])
}
return nil
}
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index ab3a6d578..b45ed0d39 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -179,7 +179,7 @@ func create(cmd *cobra.Command, args []string) error {
return errors.Errorf("pod id file exists. Ensure another pod is not using it or delete %s", podIDFile)
}
if err != nil {
- return errors.Errorf("error opening pod-id-file %s", podIDFile)
+ return errors.Errorf("opening pod-id-file %s", podIDFile)
}
defer errorhandling.CloseQuiet(podIDFD)
defer errorhandling.SyncQuiet(podIDFD)
diff --git a/cmd/podman/secrets/inspect.go b/cmd/podman/secrets/inspect.go
index 1948fef49..0977434f7 100644
--- a/cmd/podman/secrets/inspect.go
+++ b/cmd/podman/secrets/inspect.go
@@ -76,7 +76,7 @@ func inspect(cmd *cobra.Command, args []string) error {
fmt.Fprintf(os.Stderr, "error inspecting secret: %v\n", err)
}
}
- return errors.Errorf("error inspecting secret: %v", errs[0])
+ return errors.Errorf("inspecting secret: %v", errs[0])
}
return nil
}
diff --git a/cmd/podman/system/dial_stdio.go b/cmd/podman/system/dial_stdio.go
index f3445a49d..8b665bedc 100644
--- a/cmd/podman/system/dial_stdio.go
+++ b/cmd/podman/system/dial_stdio.go
@@ -88,10 +88,10 @@ func runDialStdio() error {
func copier(to halfWriteCloser, from halfReadCloser, debugDescription string) error {
defer func() {
if err := from.CloseRead(); err != nil {
- logrus.Errorf("error while CloseRead (%s): %v", debugDescription, err)
+ logrus.Errorf("while CloseRead (%s): %v", debugDescription, err)
}
if err := to.CloseWrite(); err != nil {
- logrus.Errorf("error while CloseWrite (%s): %v", debugDescription, err)
+ logrus.Errorf("while CloseWrite (%s): %v", debugDescription, err)
}
}()
if _, err := io.Copy(to, from); err != nil {
diff --git a/cmd/podman/utils/error.go b/cmd/podman/utils/error.go
index b3b54876f..2aaa71373 100644
--- a/cmd/podman/utils/error.go
+++ b/cmd/podman/utils/error.go
@@ -41,5 +41,5 @@ func ExitCodeFromBuildError(errorMsg string) (int, error) {
return buildahCLI.ExecErrorCodeGeneric, err
}
}
- return buildahCLI.ExecErrorCodeGeneric, errors.New("error message does not contains a valid exit code")
+ return buildahCLI.ExecErrorCodeGeneric, errors.New("message does not contains a valid exit code")
}