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
diff --git a/curtin/storage_config.py b/curtin/storage_config.py
index b66877c..e6c33cc 100644
--- a/curtin/storage_config.py
+++ b/curtin/storage_config.py
@@ -771,18 +771,20 @@ class BlockdevParser(ProbertParser):
771 # disk entry for ECKD dasds needs device_id and check for vtoc771 # disk entry for ECKD dasds needs device_id and check for vtoc
772 # ptable772 # ptable
773 dasd_config = self.probe_data.get('dasd', {}).get(devname)773 dasd_config = self.probe_data.get('dasd', {}).get(devname)
774 if dasd_config is not None and \774 if dasd_config is not None:
775 dasd_config.get('type', 'ECKD') == 'ECKD':775 dasd_type = dasd_config.get('type', 'ECKD')
776 device_id = (776 if dasd_type == 'ECKD':
777 blockdev_data.get('ID_PATH', '').replace('ccw-', ''))777 device_id = (
778 if device_id:778 blockdev_data.get('ID_PATH', '').replace('ccw-', ''))
779 entry['device_id'] = device_id779 if device_id:
780780 entry['device_id'] = device_id
781 # if dasd has been formatted, attrs.size is non-zero781
782 # formatted ECKD dasds have ptable type of 'vtoc'782 if dasd_type in ['ECKD', 'virt']:
783 dasd_size = blockdev_data.get('attrs', {}).get('size', "0")783 # if dasd has been formatted, attrs.size is non-zero
784 if dasd_size != "0":784 # formatted ECKD dasds have ptable type of 'vtoc'
785 entry['ptable'] = 'vtoc'785 dasd_size = blockdev_data.get('attrs', {}).get('size', "0")
786 if dasd_size != "0":
787 entry['ptable'] = 'vtoc'
786788
787 if 'ID_PART_TABLE_TYPE' in blockdev_data:789 if 'ID_PART_TABLE_TYPE' in blockdev_data:
788 ptype = blockdev_data['ID_PART_TABLE_TYPE']790 ptype = blockdev_data['ID_PART_TABLE_TYPE']

Subscribers

People subscribed via source and target branches