diff options
author | Jhon Honce <jhonce@redhat.com> | 2019-10-31 14:15:55 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2019-10-31 14:15:55 -0700 |
commit | 3bf594e262f4f0dc2a50b867ea3eaac1152cf078 (patch) | |
tree | c07ff1a53f6ce3ab2276f2387b9da542f38e3b9c /cmd | |
parent | e7540d0406c49b22de245246d16ebc6e1778df37 (diff) | |
download | podman-3bf594e262f4f0dc2a50b867ea3eaac1152cf078.tar.gz podman-3bf594e262f4f0dc2a50b867ea3eaac1152cf078.tar.bz2 podman-3bf594e262f4f0dc2a50b867ea3eaac1152cf078.zip |
Refactor test to prevent panic
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/utils.go | 3 |
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() |