summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-11-01 12:42:48 +0100
committerGitHub <noreply@github.com>2019-11-01 12:42:48 +0100
commit7c7f0000cee78aa3e13f2e467943fa2d96bc8f81 (patch)
tree939e9e383fa74d1ac6322147a51ceb3dcc1f401d /cmd/podman
parent2dae2577ccbeef502a8783c892a6c9e346153532 (diff)
parent3bf594e262f4f0dc2a50b867ea3eaac1152cf078 (diff)
downloadpodman-7c7f0000cee78aa3e13f2e467943fa2d96bc8f81.tar.gz
podman-7c7f0000cee78aa3e13f2e467943fa2d96bc8f81.tar.bz2
podman-7c7f0000cee78aa3e13f2e467943fa2d96bc8f81.zip
Merge pull request #4404 from jwhonce/wip/panic
Refactor test to prevent panic
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/utils.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go
index 592d7a1d1..c19e6391e 100644
--- a/cmd/podman/utils.go
+++ b/cmd/podman/utils.go
@@ -68,7 +68,8 @@ func aliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
// Check if a file exists and is not a directory
func checkIfFileExists(name string) bool {
file, err := os.Stat(name)
- if os.IsNotExist(err) {
+ // All errors return file == nil
+ if err != nil {
return false
}
return !file.IsDir()