diff options
author | Gonéri Le Bouder <goneri@lebouder.net> | 2021-12-09 17:46:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 16:46:27 -0600 |
commit | 24739592217e5ba91e09e8c28b852d31a2c0cc77 (patch) | |
tree | 7532f470d01e580805a5c829986ae4949f3b5064 /cloudinit | |
parent | b591e9dba6c85f3934bc309032c3e436b8dcb3ac (diff) | |
download | vyos-cloud-init-24739592217e5ba91e09e8c28b852d31a2c0cc77.tar.gz vyos-cloud-init-24739592217e5ba91e09e8c28b852d31a2c0cc77.zip |
find_devs/openbsd: accept ISO on disk (#1132)
When the metadata is an ISO image and is exposed through a disk,
the device is called `/dev/sd?a` internally. For instance `/dev/sd1a`.
It can then be mounted with `mount_cd9660 /dev/sd1a /mnt`.
Metadata in the FAT32 format are exposed as `/dev/sd?i`.
With this change, we try to mount `/dev/sd?a` in addition to `/dev/sd?i`.
Closes: https://github.com/ContainerCraft/kmi/issues/12
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/util.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index d7208f11..b9c584d1 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1217,8 +1217,9 @@ def find_devs_with_openbsd(criteria=None, oformat='device', continue if entry == 'fd0:': continue - part_id = 'a' if entry.startswith('cd') else 'i' - devlist.append(entry[:-1] + part_id) + devlist.append(entry[:-1] + 'a') + if not entry.startswith('cd'): + devlist.append(entry[:-1] + 'i') if criteria == "TYPE=iso9660": devlist = [i for i in devlist if i.startswith('cd')] elif criteria in ["LABEL=CONFIG-2", "TYPE=vfat"]: |