[blivet v2] Relax the blivet device name requirements (#1183061)

David Shea dshea at redhat.com
Fri Jan 16 18:51:52 UTC 2015


Allow ., .., and /'s in all kinds of btrfs device.
---
 blivet/devices/btrfs.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
index 13adbb4..b650854 100644
--- a/blivet/devices/btrfs.py
+++ b/blivet/devices/btrfs.py
@@ -138,6 +138,11 @@ class BTRFSDevice(StorageDevice):
             spec = super(BTRFSDevice, self).fstabSpec
         return spec
 
+    @classmethod
+    def isNameValid(cls, name):
+        # Override StorageDevice.isNameValid to allow pretty much anything
+        return not('\x00' in name)
+
 class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice, RaidDevice):
     _type = "btrfs volume"
     vol_id = btrfs.MAIN_VOLUME_ID
@@ -567,11 +572,6 @@ class BTRFSSubVolumeDevice(BTRFSDevice, RaidDevice):
         data.name = self.name
         data.preexist = self.exists
 
-    @classmethod
-    def isNameValid(cls, name):
-        # Override StorageDevice.isNameValid to allow /
-        return not('\x00' in name or name == '.' or name == '..')
-
 class BTRFSSnapShotDevice(BTRFSSubVolumeDevice):
     """ A btrfs snapshot pseudo-device.
 
-- 
2.1.0



More information about the anaconda-patches mailing list