Skip to content

Commit

Permalink
machine,rm: Ignore ENOENT while cleaning machine
Browse files Browse the repository at this point in the history
Certain paths like `../containers/podman/machine/my-test/podman.sock`
do not exist when machine is not started, so removing a machine before
starting it will result in ENOENT which we should ignore cause these
paths do not exists

Closes: containers#13834

[NO TESTS NEEDED]
[NO NEW TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
  • Loading branch information
flouthoc committed Jul 13, 2022
1 parent 4a4ac36 commit 9e3aed0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@ func (v *MachineVM) Remove(_ string, opts machine.RemoveOptions) (string, func()
return confirmationMessage, func() error {
for _, f := range files {
if err := os.Remove(f); err != nil {
if errors.Is(err, os.ErrNotExist) {
continue
}
logrus.Error(err)
}
}
Expand Down

0 comments on commit 9e3aed0

Please sign in to comment.