When changing format of a new partition, don't require wipe#2148
When changing format of a new partition, don't require wipe#2148ogayot wants to merge 2 commits intocanonical:mainfrom
Conversation
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
| if data.partition.format != partition.original_fstype(): | ||
| if data.partition.wipe is None: | ||
| raise ValueError("changing partition format requires a wipe value") | ||
| if data.partition.wipe is None and partition.preserve: |
There was a problem hiding this comment.
Should we check the value of preserve at the FS level (which may or may not exist) ? This is what we do to label "to be reformatted as ...." and "to be formatted as ....".
subiquity/subiquity/common/filesystem/labels.py
Lines 228 to 235 in ad2dd0a
There was a problem hiding this comment.
@dbungert do you know? i.e., the difference between partition.preserve and partition.fs.preserve?
There was a problem hiding this comment.
I will defer to the curtin documentation on this one. https://curtin.readthedocs.io/en/latest/topics/storage.html
From a label standpoint this is a very subtle difference.
When dealing with a new partition, changing the format from e.g. ext4 to unformatted should not require a wipe value. There is nothing yet to wipe. OTOH it is still necessary for existing partitions. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
646207f to
60693ec
Compare
| if data.partition.format != partition.original_fstype(): | ||
| if data.partition.wipe is None: | ||
| raise ValueError("changing partition format requires a wipe value") | ||
| if data.partition.wipe is None and partition.preserve: |
There was a problem hiding this comment.
Just to be clear, this works because preserve is already set for existing objects by default?
LP:#2097621