mirror of
https://github.com/containers/podman.git
synced 2025-07-04 01:48:28 +08:00
pkg/systemd: use fileutils.(Le|E)xists
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/containers/podman/v5/pkg/specgenutilexternal"
|
"github.com/containers/podman/v5/pkg/specgenutilexternal"
|
||||||
"github.com/containers/podman/v5/pkg/systemd/parser"
|
"github.com/containers/podman/v5/pkg/systemd/parser"
|
||||||
|
"github.com/containers/storage/pkg/fileutils"
|
||||||
"github.com/containers/storage/pkg/regexp"
|
"github.com/containers/storage/pkg/regexp"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -589,7 +590,7 @@ func ConvertContainer(container *parser.UnitFile, names map[string]string, isUse
|
|||||||
for _, device := range devices {
|
for _, device := range devices {
|
||||||
if device[0] == '-' {
|
if device[0] == '-' {
|
||||||
device = device[1:]
|
device = device[1:]
|
||||||
_, err := os.Stat(strings.Split(device, ":")[0])
|
err := fileutils.Exists(strings.Split(device, ":")[0])
|
||||||
if errors.Is(err, os.ErrNotExist) {
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user