Merge ~mwhudson/curtin:virt-dasds into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 3dfd1caff85c98bc4c230fbd2733d7a006381c1e
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:virt-dasds
Merge into: curtin:master
Diff against target: 37 lines (+14/-12)
1 file modified
curtin/storage_config.py (+14/-12)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
curtin developers Pending
Review via email: mp+396281@code.launchpad.net

Commit message

storage_config: set ptable to vtoc for 'virt' dasds as well as 'ECKD'

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Paride Legovini (paride) wrote :

The pylint run is flaky and *sometimes* fails with errors like:

curtin/commands/install_grub.py:88:19: E1101: Instance of 'Distros' has no 'debian' member (no-member)
curtin/commands/install_grub.py:150:28: E1101: Instance of 'Distros' has no 'redhat' member (no-member)
curtin/commands/install_grub.py:235:28: E1101: Instance of 'Distros' has no 'debian' member (no-member)

I can reproduce it locally by running `tox -e py3-pylint` a few times in a row.

Full build log:

https://paste.ubuntu.com/p/ZccwRk3MP3/

Retriggering build.

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

How does pylint end up being flak!?!? Thanks.

On Thu, 14 Jan 2021, 23:32 Paride Legovini, <email address hidden>
wrote:

> The pylint run is flaky and *sometimes* fails with errors like:
>
> curtin/commands/install_grub.py:88:19: E1101: Instance of 'Distros' has no
> 'debian' member (no-member)
> curtin/commands/install_grub.py:150:28: E1101: Instance of 'Distros' has
> no 'redhat' member (no-member)
> curtin/commands/install_grub.py:235:28: E1101: Instance of 'Distros' has
> no 'debian' member (no-member)
>
> I can reproduce it locally by running `tox -e py3-pylint` a few times in a
> row.
>
> Full build log:
>
> https://paste.ubuntu.com/p/ZccwRk3MP3/
>
> Retriggering build.
> --
> https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/396281
> You are the owner of ~mwhudson/curtin:virt-dasds.
>

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Frank tested this, it helps (although a subiquity change is required as well)

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 b66877c..e6c33cc 100644
3--- a/curtin/storage_config.py
4+++ b/curtin/storage_config.py
5@@ -771,18 +771,20 @@ class BlockdevParser(ProbertParser):
6 # disk entry for ECKD dasds needs device_id and check for vtoc
7 # ptable
8 dasd_config = self.probe_data.get('dasd', {}).get(devname)
9- if dasd_config is not None and \
10- dasd_config.get('type', 'ECKD') == 'ECKD':
11- device_id = (
12- blockdev_data.get('ID_PATH', '').replace('ccw-', ''))
13- if device_id:
14- entry['device_id'] = device_id
15-
16- # if dasd has been formatted, attrs.size is non-zero
17- # formatted ECKD dasds have ptable type of 'vtoc'
18- dasd_size = blockdev_data.get('attrs', {}).get('size', "0")
19- if dasd_size != "0":
20- entry['ptable'] = 'vtoc'
21+ if dasd_config is not None:
22+ dasd_type = dasd_config.get('type', 'ECKD')
23+ if dasd_type == 'ECKD':
24+ device_id = (
25+ blockdev_data.get('ID_PATH', '').replace('ccw-', ''))
26+ if device_id:
27+ entry['device_id'] = device_id
28+
29+ if dasd_type in ['ECKD', 'virt']:
30+ # if dasd has been formatted, attrs.size is non-zero
31+ # formatted ECKD dasds have ptable type of 'vtoc'
32+ dasd_size = blockdev_data.get('attrs', {}).get('size', "0")
33+ if dasd_size != "0":
34+ entry['ptable'] = 'vtoc'
35
36 if 'ID_PART_TABLE_TYPE' in blockdev_data:
37 ptype = blockdev_data['ID_PART_TABLE_TYPE']

Subscribers

People subscribed via source and target branches