[master 4/6] New method to handle nodev filesystems
vojtechtrefny
installerbot-noreply at redhat.com
Thu Mar 19 13:20:34 UTC 2015
From: Vojtech Trefny <vtrefny at redhat.com>
Handling nodev filesystems was originally part of getActiveMounts
method that is no longer needed.
Signed-off-by: Vojtech Trefny <vtrefny at redhat.com>
---
blivet/__init__.py | 2 +-
blivet/devicetree.py | 23 ++---------------------
2 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index c685eef..83481b6 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -387,7 +387,7 @@ def reset(self, cleanupOnly=False):
self.dumpState("initial")
if not flags.installer_mode:
- self.devicetree.getActiveMounts()
+ self.devicetree.handleNodevFilesystems()
self.updateBootLoaderDiskList()
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 75f00d0..e830a57 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -2649,9 +2649,8 @@ def resolveDevice(self, devspec, blkidTab=None, cryptTab=None, options=None):
log.debug("failed to resolve '%s'", devspec)
return device
- def getActiveMounts(self):
- """ Reflect active mounts in the appropriate devices' formats. """
- log.info("collecting information about active mounts")
+ def handleNodevFilesystems(self):
+
for line in open("/proc/mounts").readlines():
try:
(devspec, mountpoint, fstype, options, _rest) = line.split(None, 4)
@@ -2659,17 +2658,6 @@ def getActiveMounts(self):
log.error("failed to parse /proc/mounts line: %s", line)
continue
- if fstype == "btrfs":
- # get the subvol name from /proc/self/mountinfo
- for line in open("/proc/self/mountinfo").readlines():
- fields = line.split()
- _subvol = fields[3]
- _mountpoint = fields[4]
- _devspec = fields[9]
- if _mountpoint == mountpoint and _devspec == devspec:
- log.debug("subvol %s", _subvol)
- options += ",subvol=%s" % _subvol[1:]
-
if fstype in nodev_filesystems:
if not flags.include_nodev:
continue
@@ -2691,10 +2679,3 @@ def getActiveMounts(self):
n = len([d for d in self.devices if d.format.type == fstype])
device._name += ".%d" % n
self._addDevice(device)
- devspec = device.name
-
- device = self.resolveDevice(devspec, options=options)
- if device is not None:
- device.format.mountpoint = mountpoint # for future mounts
- device.format._mountpoint = mountpoint # active mountpoint
- device.format.mountopts = options
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/140e20ca888dbd656d8d1854b04e038254db5a4f
More information about the anaconda-patches
mailing list