[1/4 blivet] Only import ROOT_PATH if needed

Brian C. Lane bcl at redhat.com
Wed Jun 25 18:32:10 UTC 2014


Anaconda is going to drop ROOT_PATH, only try to import it if there is
no getTargetPhysicalRoot method available.
---
 blivet/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index 455b681..7c99782 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -115,7 +115,6 @@ def enable_installer_mode():
 
     from pyanaconda import isys # pylint: disable=redefined-outer-name
     from pyanaconda import iutil # pylint: disable=redefined-outer-name
-    from pyanaconda.constants import ROOT_PATH # pylint: disable=redefined-outer-name
     from pyanaconda.constants import shortProductName # pylint: disable=redefined-outer-name
     from pyanaconda.constants import productName # pylint: disable=redefined-outer-name
     from pyanaconda.bootloader import get_bootloader # pylint: disable=redefined-outer-name
@@ -127,6 +126,7 @@ def enable_installer_mode():
         _storageRoot = iutil.getTargetPhysicalRoot()
         _sysroot = iutil.getSysroot()
     else:
+        from pyanaconda.constants import ROOT_PATH # pylint: disable=redefined-outer-name
         _storageRoot = _sysroot = ROOT_PATH
 
     from pyanaconda.anaconda_log import program_log_lock
@@ -3128,7 +3128,7 @@ def findExistingInstallations(devicetree):
                 name = _("%(product)s Linux %(version)s for %(arch)s") % \
                         {"product": product, "version": version, "arch": architecture}
 
-        (mounts, swaps) = parseFSTab(devicetree, chroot=ROOT_PATH)
+        (mounts, swaps) = parseFSTab(devicetree, chroot=_sysroot)
         device.teardown()
         if not mounts and not swaps:
             # empty /etc/fstab. weird, but I've seen it happen.
-- 
1.9.3



More information about the anaconda-patches mailing list