[PATCH 6/8] Do not mount btrfs to list subvolumes outside installer_mode.

David Lehman dlehman at redhat.com
Tue Sep 16 16:41:09 UTC 2014


Resolves: rhbz#1015072
---
 blivet/devices.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/blivet/devices.py b/blivet/devices.py
index 5b4c368..70385b4 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -5153,10 +5153,12 @@ class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice):
         if flags.installer_mode:
             self.setup(orig=True)
 
-        try:
-            self._do_temp_mount(orig=True)
-        except errors.FSError as e:
-            log.debug("btrfs temp mount failed: %s", e)
+            try:
+                self._do_temp_mount(orig=True)
+            except errors.FSError as e:
+                log.debug("btrfs temp mount failed: %s", e)
+                return subvols
+        elif not self.originalFormat.status:
             return subvols
 
         try:
@@ -5167,7 +5169,8 @@ class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice):
         else:
             self._getDefaultSubVolumeID()
         finally:
-            self._undo_temp_mount()
+            if flags.installer_mode:
+                self._undo_temp_mount()
 
         return subvols
 
-- 
1.9.3



More information about the anaconda-patches mailing list