[blivet][PATCH] Skip device name validation for some device types.

David Lehman dlehman at redhat.com
Wed Jun 11 20:23:14 UTC 2014


Partition and loop devices' names are set by parted or losetup, so there's
no need to validate the symbolic names blivet uses. Similarly, btrfs volume
names are only used within blivet so there is no need to validate them.
---
 blivet/devices.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/blivet/devices.py b/blivet/devices.py
index 53a7d58..58f370b 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -1553,6 +1553,9 @@ class PartitionDevice(StorageDevice):
         else:
             StorageDevice.updateSysfsPath(self)
 
+    def _setName(self, value):
+        self._name = value  # actual name setting is done by parted
+
     def updateName(self):
         if self.partedPartition is None:
             self.name = self.req_name
@@ -4506,6 +4509,9 @@ class LoopDevice(StorageDevice):
         StorageDevice.__init__(self, name, fmt=fmt, size=size,
                                exists=True, parents=parents)
 
+    def _setName(self, value):
+        self._name = name   # actual name is set by losetup
+
     def updateName(self):
         """ Update this device's name. """
         if not self.slave.status:
@@ -5120,6 +5126,9 @@ class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice):
     def formatImmutable(self):
         return self.exists
 
+    def _setName(self, value):
+        self._name = name   # name is not used outside of blivet
+
     def _setFormat(self, fmt):
         """ Set the Device's format. """
         super(BTRFSVolumeDevice, self)._setFormat(fmt)
-- 
1.9.3



More information about the anaconda-patches mailing list