Merge pull request #925 from mwhudson/lp-1885644-again

add all documented fields to filesystem model classes
This commit is contained in:
Michael Hudson-Doyle 2021-04-12 11:24:23 +12:00 committed by GitHub
commit 3b60666495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

@ -52,5 +52,5 @@ storage:
- {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-system, preserve: false, id: format-system}
- {type: mount, device: format-boot, path: /boot, id: mount-boot}
- {type: mount, device: format-system, path: /, id: mount-system}
- {type: mount, device: format-boot, path: /boot, id: mount-boot, options: 'errors=remount-ro'}

View File

@ -17,7 +17,14 @@ def main():
k, expected = arg, None
v = config
for part in k.split('.'):
if '[' in part:
part, index = part.split('[')
index = int(index[:-1])
else:
index = None
v = v[part]
if index is not None:
v = v[index]
if expected is None:
print(v)
else:

View File

@ -46,6 +46,8 @@ timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoi
validate
python3 scripts/check-yaml-fields.py .subiquity/subiquity-curtin-install.conf \
debconf_selections.subiquity='"eek"'
python3 scripts/check-yaml-fields.py .subiquity/subiquity-curtin-install.conf \
storage.config[-1].options='"errors=remount-ro"'
python3 scripts/check-yaml-fields.py <(python3 scripts/check-yaml-fields.py .subiquity/etc/cloud/cloud.cfg.d/99-installer.cfg datasource.None.userdata_raw) \
locale='"en_GB.UTF-8"'
grep -q 'finish: subiquity/Install/install/postinstall/install_package1: SUCCESS: installing package1' \

View File

@ -926,6 +926,8 @@ class Partition(_Formattable):
number = attr.ib(default=None)
preserve = attr.ib(default=False)
grub_device = attr.ib(default=False)
name = attr.ib(default=None)
multipath = attr.ib(default=None)
@property
def annotations(self):
@ -1087,7 +1089,9 @@ class Raid(_Device):
backlink="_constructed_device", default=attr.Factory(set))
preserve = attr.ib(default=False)
wipe = attr.ib(default=None)
ptable = attributes.ptable()
metadata = attr.ib(default=None)
@property
def size(self):
@ -1217,6 +1221,7 @@ class LVM_LogicalVolume(_Formattable):
name = attr.ib()
volgroup = attributes.ref(backlink="_partitions") # LVM_VolGroup
size = attributes.size()
wipe = attr.ib(default=None)
preserve = attr.ib(default=False)
@ -1305,6 +1310,7 @@ class Filesystem:
label = attr.ib(default=None)
uuid = attr.ib(default=None)
preserve = attr.ib(default=False)
extra_options = attr.ib(default=None)
_mount = attributes.backlink()
@ -1326,6 +1332,9 @@ class Filesystem:
class Mount:
device = attributes.ref(backlink="_mount") # Filesystem
path = attr.ib()
fstype = attr.ib(default=None)
options = attr.ib(default=None)
spec = attr.ib(default=None)
def can_delete(self):
# Can't delete mount of /boot/efi or swap, anything else is fine.