pkg/machine: use fileutils.(Le|E)xists

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2024-04-10 18:27:43 +02:00
parent cbffddc72e
commit af24326133
13 changed files with 34 additions and 24 deletions

View File

@ -5,11 +5,11 @@ import (
"bytes"
"fmt"
"net"
"os"
"path/filepath"
"time"
"github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/storage/pkg/fileutils"
"github.com/sirupsen/logrus"
)
@ -101,7 +101,7 @@ func WaitForSocketWithBackoffs(maxBackoffs int, backoff time.Duration, socketPat
backoffWait := backoff
logrus.Debugf("checking that %q socket is ready", name)
for i := 0; i < maxBackoffs; i++ {
_, err := os.Stat(socketPath)
err := fileutils.Exists(socketPath)
if err == nil {
return nil
}