summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/util.py5
-rw-r--r--tests/unittests/test_util.py4
2 files changed, 5 insertions, 4 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"]:
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index eab374bc..c551835f 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -2330,7 +2330,7 @@ class TestFindDevs:
def test_find_devs_with_openbsd(self, m_subp):
m_subp.return_value = ('cd0:,sd0:630d98d32b5d3759,sd1:,fd0:', '')
devlist = util.find_devs_with_openbsd()
- assert devlist == ['/dev/cd0a', '/dev/sd1i']
+ assert devlist == ['/dev/cd0a', '/dev/sd1a', '/dev/sd1i']
@mock.patch('cloudinit.subp.subp')
def test_find_devs_with_openbsd_with_criteria(self, m_subp):
@@ -2340,7 +2340,7 @@ class TestFindDevs:
# lp: #1841466
devlist = util.find_devs_with_openbsd(criteria="LABEL_FATBOOT=A_LABEL")
- assert devlist == ['/dev/cd0a', '/dev/sd1i']
+ assert devlist == ['/dev/cd0a', '/dev/sd1a', '/dev/sd1i']
@pytest.mark.parametrize(
'criteria,expected_devlist',