Skip to content

Commit

Permalink
storage: when changing format of a new partition, don't require wipe
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ogayot committed Jan 27, 2025
1 parent 78b2719 commit 60693ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions subiquity/server/controllers/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,8 +1404,10 @@ async def v2_edit_partition_POST(
# format="".
if data.partition.format is not None:
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:
raise ValueError(
"changing format of existing partition requires a wipe value"
)
spec["fstype"] = data.partition.format
if data.partition.size is not None:
spec["size"] = data.partition.size
Expand Down

0 comments on commit 60693ec

Please sign in to comment.