diff options
Diffstat (limited to 'ironic_python_agent/extensions/image.py')
| -rw-r--r-- | ironic_python_agent/extensions/image.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index b6d1f0ea..e5b1b1aa 100644 --- a/ironic_python_agent/extensions/image.py +++ b/ironic_python_agent/extensions/image.py @@ -48,7 +48,8 @@ def _get_partition(device, uuid): LOG.warning("Couldn't re-read the partition table " "on device %s", device) - report = utils.execute('lsblk', '-PbioKNAME,UUID,TYPE', device)[0] + lsblk = utils.execute('lsblk', '-PbioKNAME,UUID,PARTUUID,TYPE', device) + report = lsblk[0] for line in report.split('\n'): part = {} # Split into KEY=VAL pairs @@ -63,6 +64,10 @@ def _get_partition(device, uuid): LOG.debug("Partition %(uuid)s found on device " "%(dev)s", {'uuid': uuid, 'dev': device}) return '/dev/' + part.get('KNAME') + if part.get('PARTUUID') == uuid: + LOG.debug("Partition %(uuid)s found on device " + "%(dev)s", {'uuid': uuid, 'dev': device}) + return '/dev/' + part.get('KNAME') else: error_msg = ("No partition with UUID %(uuid)s found on " "device %(dev)s" % {'uuid': uuid, 'dev': device}) |
