storage/v2: start using -1 for 'rest of disk'

This commit is contained in:
Dan Bungert 2021-09-27 11:52:34 -06:00
parent 69873d8ab2
commit 92500bf8c9
2 changed files with 3 additions and 5 deletions

View File

@ -138,11 +138,10 @@ async def v2(client):
data = {
'disk_id': disk_id,
'partition': {
'size': 0,
'size': -1,
'number': 4,
'mount': '',
'format': '',
'annotations': None
}
}
await client.post('/storage/v2/delete_partition', data)
@ -150,11 +149,10 @@ async def v2(client):
data = {
'disk_id': disk_id,
'partition': {
'size': 0,
'size': -1,
'number': 2,
'mount': '/',
'format': 'ext3',
'annotations': None
}
}
await client.post('/storage/v2/add_partition', data)

View File

@ -321,7 +321,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
-> StorageResponseV2:
disk = self.model._one(id=data.disk_id)
size = data.partition.size
if not size:
if size is None or size < 0:
size = disk.free_for_partitions
flag = ""
wipe = "superblock"