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

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Dan Watkins
Approved revision: 788630651611669da45e79364871e7a4d29f30c8
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:lp-1847771
Merge into: curtin:master
Diff against target: 30 lines (+3/-3)
1 file modified
curtin/storage_config.py (+3/-3)
Reviewer Review Type Date Requested Status
Dan Watkins (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+374103@code.launchpad.net

Commit message

storage_config: interpret value, not presence, of DM_MULTIPATH_DEVICE_PATH

Curtin assumes any block device that has the DM_MULTIPATH_DEVICE_PATH
key set in udev is a block device, but that's not correct. Since
multipath-tools 0.7.7 (according to
https://www.spinics.net/lists/dm-devel/msg35965.html), _every_ block
device that multipathd looks at gets that key set, but it is set to "1"
for things that are part of a multipathed device and "0" for things that
are not. So fix the checks in curtin to follow that.

Description of the change

Not tested. But probably right?

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I've tested this now and it prevents the crash on my laptop (whereas the current daily crashes)

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paride Legovini (paride) wrote :

This is a bit annoying as I didn't change anything to make the CI run work.

The "torkoal" job runs on amd64 and includes a short vmtest run. The run failed as curtin took more than 3000s to install Bionic. When I tried manually keeping an eye on the logs in worked; when I tried it again from Jenkins it worked (CI run #3). But in the same run the s390x run failed:

======================================================================
ERROR: test_needs_formatting_layout_mismatch (unittests.test_block_dasd.TestNeedsFormatting)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/servers/server/workspace/curtin-ci/nodes/metal-s390x/curtin-3737/tests/unittests/test_block_dasd.py", line 311, in setUp
    self.dasd = dasd.DasdDevice(random_device_id())
  File "/var/lib/jenkins/servers/server/workspace/curtin-ci/nodes/metal-s390x/curtin-3737/curtin/block/dasd.py", line 309, in __init__
    super(DasdDevice, self).__init__(device_id)
  File "/var/lib/jenkins/servers/server/workspace/curtin-ci/nodes/metal-s390x/curtin-3737/curtin/block/dasd.py", line 283, in __init__
    _valid_device_id(self.device_id)
  File "/var/lib/jenkins/servers/server/workspace/curtin-ci/nodes/metal-s390x/curtin-3737/curtin/block/dasd.py", line 274, in _valid_device_id
    "device_id invalid: devno not in 0-0x10000: '%s'" % dev)
ValueError: device_id invalid: devno not in 0-0x10000: '10000'

Full output: https://paste.ubuntu.com/p/7MTR8wvxFn/

It worked when I re-run it manually, and then worked when I re-run it from Jenkins.

Revision history for this message
Dan Watkins (oddbloke) wrote :

This looks reasonable to me, but I'd like Ryan's review too.

Revision history for this message
Dan Watkins (oddbloke) wrote :

OK, as Ryan is out today, I've dug into this more, and I'm happy to land it. Thanks Michael!

review: Approve
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Thanks for the quick review and merge!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/storage_config.py b/curtin/storage_config.py
2index 942bc75..3bfa466 100644
3--- a/curtin/storage_config.py
4+++ b/curtin/storage_config.py
5@@ -422,7 +422,7 @@ class ProbertParser(object):
6 return None
7
8 def is_mpath(self, blockdev):
9- if 'DM_MULTIPATH_DEVICE_PATH' in blockdev:
10+ if blockdev.get('DM_MULTIPATH_DEVICE_PATH') == "1":
11 return True
12
13 return bool('mpath-' in blockdev.get('DM_UUID', ''))
14@@ -442,7 +442,7 @@ class ProbertParser(object):
15 return rv
16
17 def find_mpath_member(self, blockdev):
18- if 'DM_MULTIPATH_DEVICE_PATH' in blockdev:
19+ if blockdev.get('DM_MULTIPATH_DEVICE_PATH') == "1":
20 # find all other DM_MULTIPATH_DEVICE_PATH devs with same serial
21 serial = blockdev.get('ID_SERIAL')
22 members = sorted([os.path.basename(dev['DEVNAME'])
23@@ -730,7 +730,7 @@ class BlockdevParser(ProbertParser):
24 'type': blockdev_data['DEVTYPE'],
25 'id': self.blockdev_to_id(blockdev_data),
26 }
27- if 'DM_MULTIPATH_DEVICE_PATH' in blockdev_data:
28+ if blockdev_data.get('DM_MULTIPATH_DEVICE_PATH') == "1":
29 mpath_name = self.get_mpath_name(blockdev_data)
30 entry['multipath'] = mpath_name
31

Subscribers

People subscribed via source and target branches