Merge ~mwhudson/curtin:fix-raid-ptable-logic into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: c861880f22c47ea54fdd5691760e551434cf24cf
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:fix-raid-ptable-logic
Merge into: curtin:master
Diff against target: 41 lines (+10/-2)
2 files modified
curtin/commands/block_meta.py (+2/-1)
examples/tests/raid-partition-to-disk.yaml (+8/-1)
Reviewer Review Type Date Requested Status
Dan Bungert Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+406428@code.launchpad.net

Commit message

disk_handler: fix partitioning a new RAID

The commmit "disk_handler: check wipe field when deciding whether to
reformat raids" fixed the case of putting a partition on an existing
raid but broke the case of putting a partition on a new RAID.

I adapted a vmtest to exercise this path too.

Description of the change

oops

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
Dan Bungert (dbungert) wrote :

LGTM.
Semi-related question - do we need to do a s/Groovy/Impish on the vmtests?

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

> Semi-related question - do we need to do a s/Groovy/Impish on the vmtests?

Yes, I guess so! Certainly testing groovy is pointless now. I think there is a script for this.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
2index e5cf659..aae85c6 100644
3--- a/curtin/commands/block_meta.py
4+++ b/curtin/commands/block_meta.py
5@@ -592,7 +592,8 @@ def disk_handler(info, storage_config):
6 if info['type'] == 'disk':
7 preserve_ptable = config.value_as_boolean(info.get('preserve'))
8 else:
9- preserve_ptable = not config.value_as_boolean(info.get('wipe'))
10+ preserve_ptable = config.value_as_boolean(info.get('preserve')) \
11+ and not config.value_as_boolean(info.get('wipe'))
12 if preserve_ptable:
13 # Handle preserve flag, verifying if ptable specified in config
14 if ptable and ptable != PTABLE_UNSUPPORTED:
15diff --git a/examples/tests/raid-partition-to-disk.yaml b/examples/tests/raid-partition-to-disk.yaml
16index 9c16c26..d3dfd29 100644
17--- a/examples/tests/raid-partition-to-disk.yaml
18+++ b/examples/tests/raid-partition-to-disk.yaml
19@@ -49,6 +49,13 @@ storage:
20 - disk-b
21 - disk-c
22 raidlevel: raid1
23+ ptable: gpt
24+
25+ - type: partition
26+ id: md1_part1
27+ device: md1
28+ number: 1
29+ size: 5G
30
31 - type: format
32 id: id_efi_format
33@@ -56,7 +63,7 @@ storage:
34 fstype: fat32
35 - type: format
36 id: id_root_format
37- volume: md1
38+ volume: md1_part1
39 fstype: ext4
40
41 - type: mount

Subscribers

People subscribed via source and target branches