Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Don't let a swap off fail cause teardown failure
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGarbutt committed Jan 7, 2019
1 parent 45246e7 commit 3af7c86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/pfsprovider/ansible/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ func umount(fsType FSType, volume registry.Volume, brickAllocations []registry.B
swapFile := path.Join(mountDir, fmt.Sprintf("/swap/%s", attachment.Hostname)) // TODO share?
loopback := fmt.Sprintf("/dev/loop%d", volume.ClientPort) // TODO share?
if err := swapOff(attachment.Hostname, loopback); err != nil {
return err
log.Printf("Warn: failed to swap off %+v", attachment)
}
if err := detachLoopback(attachment.Hostname, loopback); err != nil {
return err
log.Printf("Warn: failed to detach loopback %+v", attachment)
}
if err := removeSubtree(attachment.Hostname, swapFile); err != nil {
return err
Expand Down

0 comments on commit 3af7c86

Please sign in to comment.