[PATCH] Check fstab entries against fmt.mountType not fmt.type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is what mountType is there for.

Also move the declaration of mountType up to DeviceFormat so that
SwapSpace inherits it.

Resolves: rhbz#594032
---
 pyanaconda/storage/__init__.py         |    4 ++--
 pyanaconda/storage/formats/__init__.py |    8 ++++++++
 pyanaconda/storage/formats/fs.py       |    8 --------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index da4bbe4..4d71d22 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1715,9 +1715,9 @@ class FSSet(object):
 
         # make sure, if we're using a device from the tree, that
         # the device's format we found matches what's in the fstab
-        if fstype != "auto" and fmt.type != device.format.type:
+        if fstype != "auto" and fmt.mountType != device.format.type and fmt:
             raise StorageError("scanned format (%s) differs from fstab "
-                        "format (%s)" % (device.format.type, fstype))
+                        "format (%s)" % (device.format.mountType, fmt.mountType))
 
         if device.format.mountable:
             device.format.mountpoint = mountpoint
diff --git a/pyanaconda/storage/formats/__init__.py b/pyanaconda/storage/formats/__init__.py
index 4c4e173..95308bb 100644
--- a/pyanaconda/storage/formats/__init__.py
+++ b/pyanaconda/storage/formats/__init__.py
@@ -141,6 +141,7 @@ def get_device_format_class(fmt_type):
 class DeviceFormat(object):
     """ Generic device format. """
     _type = None
+    _mountType = None                    # like _type but for passing to mount
     _name = "Unknown"
     _udevTypes = []
     partedFlag = None
@@ -232,6 +233,13 @@ class DeviceFormat(object):
     def type(self):
         return self._type
 
+    @property
+    def mountType(self):
+        if not self._mountType:
+            self._mountType = self._type
+
+        return self._mountType
+
     def probe(self):
         log_method_call(self, device=self.device,
                         type=self.type, status=self.status)
diff --git a/pyanaconda/storage/formats/fs.py b/pyanaconda/storage/formats/fs.py
index 7966312..85bdb6b 100644
--- a/pyanaconda/storage/formats/fs.py
+++ b/pyanaconda/storage/formats/fs.py
@@ -107,7 +107,6 @@ def fsConfigFromFile(config_file):
 class FS(DeviceFormat):
     """ Filesystem class. """
     _type = "Abstract Filesystem Class"  # fs type name
-    _mountType = None                    # like _type but for passing to mount
     _name = None
     _mkfs = ""                           # mkfs utility
     _modules = []                        # kernel modules required for support
@@ -829,13 +828,6 @@ class FS(DeviceFormat):
 
         return _type
 
-    @property
-    def mountType(self):
-        if not self._mountType:
-            self._mountType = self._type
-
-        return self._mountType
-
     # These methods just wrap filesystem-specific methods in more
     # generically named methods so filesystems and formatted devices
     # like swap and LVM physical volumes can have a common API.
-- 
1.7.3.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux