This commit is contained in:
Michael Hudson-Doyle 2020-05-05 23:05:59 +12:00
parent bc6e859109
commit ba106bbbed
2 changed files with 4 additions and 2 deletions

View File

@ -37,8 +37,8 @@ storage:
- {type: partition, device: disk-2, size: 1M, wipe: superblock, flag: bios_grub, number: 1, preserve: false, id: partition-grub-2} - {type: partition, device: disk-2, size: 1M, wipe: superblock, flag: bios_grub, number: 1, preserve: false, id: partition-grub-2}
- {type: partition, device: disk-1, size: 1G, wipe: superblock, number: 2, preserve: false, id: partition-boot-1} - {type: partition, device: disk-1, size: 1G, wipe: superblock, number: 2, preserve: false, id: partition-boot-1}
- {type: partition, device: disk-2, size: 1G, wipe: superblock, number: 2, preserve: false, id: partition-boot-2} - {type: partition, device: disk-2, size: 1G, wipe: superblock, number: 2, preserve: false, id: partition-boot-2}
- {type: partition, device: disk-1, size: 3G, wipe: superblock, number: 3, preserve: false, id: partition-system-1} - {type: partition, device: disk-1, size: 17%, wipe: superblock, number: 3, preserve: false, id: partition-system-1}
- {type: partition, device: disk-2, size: 3G, wipe: superblock, number: 3, preserve: false, id: partition-system-2} - {type: partition, device: disk-2, size: 17%, wipe: superblock, number: 3, preserve: false, id: partition-system-2}
- {type: raid, name: md0, raidlevel: raid1, devices: [partition-boot-1, partition-boot-2], preserve: false, id: raid-boot} - {type: raid, name: md0, raidlevel: raid1, devices: [partition-boot-1, partition-boot-2], preserve: false, id: raid-boot}
- {type: raid, name: md1, raidlevel: raid1, devices: [partition-system-1, partition-system-2], preserve: false, id: raid-system} - {type: raid, name: md1, raidlevel: raid1, devices: [partition-system-1, partition-system-2], preserve: false, id: raid-system}
- {type: format, fstype: ext4, volume: raid-boot, preserve: false, id: format-boot} - {type: format, fstype: ext4, volume: raid-boot, preserve: false, id: format-boot}

View File

@ -14,6 +14,7 @@ class StorageChecker:
def _check_partition(self, action): def _check_partition(self, action):
assert 'device' in action assert 'device' in action
assert 'size' in action assert 'size' in action
assert action['size'] % 512 == 0
assert 'number' in action assert 'number' in action
assert action['device'] in self.actions assert action['device'] in self.actions
assert 'ptable' in self.actions[action['device']] assert 'ptable' in self.actions[action['device']]
@ -49,6 +50,7 @@ class StorageChecker:
assert 'name' in action assert 'name' in action
assert 'size' in action assert 'size' in action
assert isinstance(action['size'], str) assert isinstance(action['size'], str)
assert int(action['size'][:-1]) % 512 == 0
assert action['volgroup'] in self.actions assert action['volgroup'] in self.actions
def check(self, action): def check(self, action):