Merge ~mwhudson/curtin:lp-1876626 into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Chad Smith
Approved revision: 61a11664e749d216555e0241335717f538cca22c
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:lp-1876626
Merge into: curtin:master
Diff against target: 16 lines (+6/-0)
1 file modified
curtin/block/__init__.py (+6/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
Review via email: mp+383319@code.launchpad.net

Commit message

block.detect_multipath: ignore fake "devices" from /proc/mounts

A tmpfs can be mounted with any old junk in the "device" field and
unfortunately casper sometimes puts "/dev/shm" there, which is usually a
directory. Ignore such cases.

LP: #1876626

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

Thanks!

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

Commit message lints:
- Line #4 has 2 too many characters. Line starts with: "directory. Ignore such"...

review: Needs Fixing
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

Spurious failure on ppc64 node; could be lab vpn related; I was having some trouble as well. I think autolander will retry.

Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/__init__.py b/curtin/block/__init__.py
2index a7fe22f..c006aa4 100644
3--- a/curtin/block/__init__.py
4+++ b/curtin/block/__init__.py
5@@ -637,6 +637,12 @@ def detect_multipath(target_mountpoint=None):
6 for device in (os.path.realpath(dev)
7 for (dev, _mp, _vfs, _opts, _freq, _passno)
8 in get_proc_mounts() if dev.startswith('/dev/')):
9+ if not is_block_device(device):
10+ # A tmpfs can be mounted with any old junk in the "device"
11+ # field and unfortunately casper sometimes puts "/dev/shm"
12+ # there, which is usually a directory. Ignore such cases.
13+ # (See https://bugs.launchpad.net/bugs/1876626)
14+ continue
15 if _device_is_multipathed(device):
16 return device
17

Subscribers

People subscribed via source and target branches