[blivet:master] Check the status of the format being mounted.

mulhern amulhern at redhat.com
Mon Dec 8 18:57:19 UTC 2014


Previous code checked the status of the format attribute. It seems
to make more sense to wait and check the status of the format selected
to be actually mounted, which may be the originalFormat attribute.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devices/btrfs.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
index 5061af1..13adbb4 100644
--- a/blivet/devices/btrfs.py
+++ b/blivet/devices/btrfs.py
@@ -92,15 +92,19 @@ class BTRFSDevice(StorageDevice):
         return "btrfs-tmp.%s" % self.id
 
     def _do_temp_mount(self, orig=False):
-        if self.format.status or not self.exists:
+        if not self.exists:
             return
 
-        tmpdir = tempfile.mkdtemp(prefix=self._temp_dir_prefix)
         if orig:
             fmt = self.originalFormat
         else:
             fmt = self.format
 
+        if fmt.status:
+            return
+
+        tmpdir = tempfile.mkdtemp(prefix=self._temp_dir_prefix)
+
         fmt.mount(mountpoint=tmpdir)
 
     def _undo_temp_mount(self):
-- 
1.9.3



More information about the anaconda-patches mailing list