[partdisks] Check if disk labels support partition names

parent acd87206
......@@ -443,6 +443,14 @@ def delete_partition(obj):
# Remove this partition
return disk.deletePartition(obj)
def check_disk_label_name_support(obj):
""" Checks if disk labels support partition names. """
disk = disks[os.path.basename(return_device(obj.path))]
if disk.supportsFeature(p.DISK_TYPE_PARTITION_NAME):
return True
else:
return False
def get_supported_filesystems():
""" Returns a list of supported filesystems. """
......
......@@ -2640,7 +2640,7 @@ class Frontend(glade.Frontend):
name.append(self.distribs[path])
if (path in crypt.LUKSdevices or "crypt" in self.changed[path]["changes"]) and not "format" in self.changed[path]["changes"] and not ("PVcreate" in self.changed[path]["changes"] and not "crypt" in self.changed[path]["changes"]):
name.append("Encrypted partition")
elif name and part.name:
elif name and lib.check_disk_label_name_support(part):
name.append(part.name)
elif not path in self.distribs or path in self.previously_changed or self.changed[path]["changes"] != {}:
name.append("Normal partition")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment