summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2019-10-31 14:15:55 -0700
committerJhon Honce <jhonce@redhat.com>2019-10-31 14:15:55 -0700
commit3bf594e262f4f0dc2a50b867ea3eaac1152cf078 (patch)
treec07ff1a53f6ce3ab2276f2387b9da542f38e3b9c
parente7540d0406c49b22de245246d16ebc6e1778df37 (diff)
downloadpodman-3bf594e262f4f0dc2a50b867ea3eaac1152cf078.tar.gz
podman-3bf594e262f4f0dc2a50b867ea3eaac1152cf078.tar.bz2
podman-3bf594e262f4f0dc2a50b867ea3eaac1152cf078.zip
Refactor test to prevent panic
Signed-off-by: Jhon Honce <jhonce@redhat.com>
-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()