[master 1/1] In FS._postSetup() check the mountpoint options that were actually used.
mulkieran
installerbot-noreply at redhat.com
Wed Apr 15 17:07:57 UTC 2015
From: mulhern <amulhern at redhat.com>
Should have gone in with commit 10bc41e6f73796298a3a78faaf69dd363429ea53.
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/formats/fs.py | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 5f25eb9..6583267 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -634,6 +634,24 @@ def _preSetup(self, **kwargs):
return not self.status
+ def _setupOptions(self, options):
+ """ The options actually used to mount the filesystem.
+
+ These are not necessarily the same as either the default options
+ or the options argument.
+
+ :param str options: the mount options passed to setup() method.
+ :returns: the mount options used by setup
+ :rtype: str
+ """
+ if not options or not isinstance(options, str):
+ options = self.options
+
+ if isinstance(self, BindFS):
+ options = "bind," + options
+
+ return options
+
def _setup(self, **kwargs):
""" Mount this filesystem.
@@ -643,7 +661,7 @@ def _setup(self, **kwargs):
:keyword mountpoint: mountpoint (overrides self.mountpoint)
:raises: FSError
"""
- options = kwargs.get("options", "")
+ options = self._setupOptions(kwargs.get("options", ""))
chroot = kwargs.get("chroot", "/")
mountpoint = kwargs.get("mountpoint") or self.mountpoint
@@ -658,13 +676,6 @@ def _setup(self, **kwargs):
if self.systemMountpoint == chrootedMountpoint:
return
- # passed in options override default options
- if not options or not isinstance(options, str):
- options = self.options
-
- if isinstance(self, BindFS):
- options = "bind," + options
-
try:
rc = util.mount(self.device, chrootedMountpoint,
fstype=self.mountType,
@@ -676,7 +687,7 @@ def _setup(self, **kwargs):
raise FSError("mount failed: %s" % rc)
def _postSetup(self, **kwargs):
- options = kwargs.get("options", "")
+ options = self._setupOptions(kwargs.get("options", ""))
chroot = kwargs.get("chroot", "/")
mountpoint = kwargs.get("mountpoint") or self.mountpoint
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/c25cbc6f6dbd5bd630845df02d13f7c934febdd2
More information about the anaconda-patches
mailing list