Olivier Gayot has proposed merging
~ogayot/curtin:re-get_partition_sfdisk_info-syntax-error into curtin:master.
Requested reviews:
curtin developers (curtin-dev)
Related bugs:
Bug #2059414 in curtin: "Syntax error on curtin/block/__init__.py#L317-L318"
https://bugs.launchpad.net/curtin/+bug/2059414
For more details, see:
https://code.launchpad.net/~ogayot/curtin/+git/curtin/+merge/482057
For some reason, we lost this change that was merged in
https://code.launchpad.net/~ogayot/curtin/+git/curtin/+merge/474163
--
Your team curtin developers is requested to review the proposed merge of
~ogayot/curtin:re-get_partition_sfdisk_info-syntax-error into curtin:master.
diff --git a/curtin/block/__init__.py b/curtin/block/__init__.py
index 497372d..8b0f17c 100644
--- a/curtin/block/__init__.py
+++ b/curtin/block/__init__.py
@@ -316,7 +316,7 @@ def get_partition_sfdisk_info(devpath, sfdisk_info=None):
if os.path.realpath(part['node']) == os.path.realpath(devpath)]
if len(entry) != 1:
raise RuntimeError('Device %s not present in sfdisk dump:\n%s' %
- devpath, util.json_dumps(sfdisk_info))
+ (devpath, util.json_dumps(sfdisk_info)))
return entry.pop()
diff --git a/tests/unittests/test_block.py b/tests/unittests/test_block.py
index 2818fe4..9fcdb43 100644
--- a/tests/unittests/test_block.py
+++ b/tests/unittests/test_block.py
@@ -192,6 +192,11 @@ class TestBlock(CiTestCase):
m_exists.return_value = False
self.assertEqual(None, block.disk_to_byid_path('/dev/sdb'))
+ def test_get_partition_sfdisk_info__not_present(self):
+ with self.assertRaisesRegex(RuntimeError,
+ "not present in sfdisk dump"):
+ block.get_partition_sfdisk_info("/dev/sda1", {"partitions": []})
+
class TestSysBlockPath(CiTestCase):
@mock.patch("os.path.exists")
--
Mailing list: https://launchpad.net/~curtin-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~curtin-dev
More help : https://help.launchpad.net/ListHelp