spacepaste

  1.  
  2. diff --git a/ironic_lib/disk_utils.py b/ironic_lib/disk_utils.py
  3. index 3655891..f2d165d 100644
  4. --- a/ironic_lib/disk_utils.py
  5. +++ b/ironic_lib/disk_utils.py
  6. @@ -325,10 +325,15 @@ def populate_image(src, dst):
  7. def block_uuid(dev):
  8. - """Get UUID of a block device."""
  9. + """Get UUID of a block device.
  10. +
  11. + Try to fetch the UUID, if that fails, try to fetch the PARTUUID.
  12. + """
  13. out, _err = utils.execute('blkid', '-s', 'UUID', '-o', 'value', dev,
  14. - run_as_root=True,
  15. - check_exit_code=[0])
  16. + run_as_root=True, check_exit_code=[0])
  17. + if out is '':
  18. + out, _err = utils.execute('blkid', '-s', 'PARTUUID', '-o', 'value',
  19. + dev, run_as_root=True, check_exit_code=[0])
  20. return out.strip()
  21.