[blivet:master 1/2] Revert "Revive the mountExistingSystem() function and all it needs"

mulhern amulhern at redhat.com
Mon Mar 9 17:16:29 UTC 2015


This reverts commit 5d5e27aad2033135793d6a2dd4967f87e256e30e.

It revives an obsolete version and a deleted exception class, as well
as implying the existance of some deleted format methods.
---
 blivet/errors.py    |  5 -----
 blivet/osinstall.py | 50 +-------------------------------------------------
 2 files changed, 1 insertion(+), 54 deletions(-)

diff --git a/blivet/errors.py b/blivet/errors.py
index 360c440..b05c0c7 100644
--- a/blivet/errors.py
+++ b/blivet/errors.py
@@ -80,11 +80,6 @@ class FSResizeError(FSError):
         FSError.__init__(self, message)
         self.details = details
 
-class DirtyFSError(FSError):
-    def __init__(self, devices):
-        FSError.__init__(self)
-        self.devices = devices
-
 class LUKSError(DeviceFormatError):
     pass
 
diff --git a/blivet/osinstall.py b/blivet/osinstall.py
index 23b1c33..b2fd9e1 100644
--- a/blivet/osinstall.py
+++ b/blivet/osinstall.py
@@ -31,7 +31,7 @@ from . import getSysroot, getTargetPhysicalRoot, errorHandler, ERROR_RAISE
 
 from .storage_log import log_exception_info
 from .devices import FileDevice, NFSDevice, NoDevice, OpticalDevice, NetworkStorageDevice, DirectoryDevice
-from .errors import FSTabTypeMismatchError, UnrecognizedFSTabEntryError, StorageError, FSResizeError, UnknownSourceDeviceError, DeviceError, DirtyFSError
+from .errors import FSTabTypeMismatchError, UnrecognizedFSTabEntryError, StorageError, FSResizeError, UnknownSourceDeviceError
 from .formats import get_device_format_class
 from .formats import getFormat
 from .flags import flags
@@ -1126,51 +1126,3 @@ def storageInitialize(storage, ksdata, protected):
                                          if d.name not in ksdata.ignoredisk.ignoredisk]
             log.debug("onlyuse is now: %s", ",".join(ksdata.ignoredisk.onlyuse))
 
-def mountExistingSystem(fsset, rootDevice,
-                        allowDirty=None, dirtyCB=None,
-                        readOnly=None):
-    """ Mount filesystems specified in rootDevice's /etc/fstab file. """
-
-    rootPath = getSysroot()
-    if dirtyCB is None:
-        dirtyCB = lambda l: False
-
-    if readOnly:
-        readOnly = "ro"
-    else:
-        readOnly = ""
-
-    if rootDevice.protected and os.path.ismount("/mnt/install/isodir"):
-        util.mount("/mnt/install/isodir",
-                   rootPath,
-                   fstype=rootDevice.format.type,
-                   options="bind")
-    else:
-        rootDevice.setup()
-        rootDevice.format.mount(chroot=rootPath,
-                                mountpoint="/",
-                                options=readOnly)
-
-    fsset.parseFSTab()
-
-    # check for dirty filesystems
-    dirtyDevs = []
-    for device in fsset.mountpoints.values():
-        if not hasattr(device.format, "needsFSCheck"):
-            continue
-
-        try:
-            device.setup()
-        except DeviceError:
-            # we'll catch this in the main loop
-            continue
-
-        if device.format.needsFSCheck:
-            log.info("%s contains a dirty %s filesystem", device.path,
-                                                          device.format.type)
-            dirtyDevs.append(device.path)
-
-    if dirtyDevs and (not allowDirty or dirtyCB(dirtyDevs)):
-        raise DirtyFSError(dirtyDevs)
-
-    fsset.mountFilesystems(rootPath=getSysroot(), readOnly=readOnly, skipRoot=True)
-- 
2.1.0



More information about the anaconda-patches mailing list