ref #2349 -- corregir error de sfdisk en disco no GPT
parent
eecb19bef6
commit
749b1fee8d
|
@ -82,7 +82,13 @@ class DiskLibrary:
|
|||
|
||||
(disk, partno) = self.split_device_partition(device)
|
||||
|
||||
result = subprocess.run(["/usr/sbin/sfdisk", "--part-uuid", disk, str(partno)], check=True, capture_output=True, encoding='utf-8')
|
||||
result = subprocess.run(["/usr/sbin/sfdisk", "--part-uuid", disk, str(partno)], check=False, capture_output=True, encoding='utf-8')
|
||||
if result.returncode != 0:
|
||||
# We're using a DOS partition table, no UUID.
|
||||
if "failed to get partition UUID" in result.stderr:
|
||||
return ""
|
||||
raise subprocess.CalledProcessError(result.returncode, result.args)
|
||||
|
||||
return result.stdout.strip()
|
||||
|
||||
def set_partition_uuid(self, device, uuid):
|
||||
|
|
Loading…
Reference in New Issue