[PATCH] Adjust for movement of functions from examples into blivet proper.

David Lehman dlehman at redhat.com
Mon May 5 23:54:47 UTC 2014


---
 tests/gui/outside/__init__.py   |  9 +++------
 tests/storage/cases/__init__.py | 13 ++++---------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/tests/gui/outside/__init__.py b/tests/gui/outside/__init__.py
index 918a23b..427977d 100644
--- a/tests/gui/outside/__init__.py
+++ b/tests/gui/outside/__init__.py
@@ -19,9 +19,6 @@
 
 __all__ = ["Creator", "OutsideMixin"]
 
-# Can't import from a directory with a dash in its name.  This will have to do.
-execfile("/usr/share/doc/python-blivet/examples/common.py")
-
 import blivet
 
 from contextlib import contextmanager
@@ -133,7 +130,7 @@ class Creator(object):
         b = blivet.Blivet()
 
         # pylint: disable=undefined-variable
-        disk1_path = create_sparse_file(b, "suite", blivet.size.Size(spec="11 MB"))
+        disk1_path = blivet.util.create_sparse_tempfile("suite", blivet.size.Size(spec="11 MB"))
         b.config.diskImages["suite"] = disk1_path
 
         b.reset()
@@ -170,7 +167,7 @@ class Creator(object):
                                          "anacondaArgs": config.get("anacondaArgs", "")})
         finally:
             # pylint: disable=undefined-variable
-            tear_down_disk_images(b)
+            b.devicetree.tearDownDiskImages()
             shutil.rmtree(self.mountpoint)
 
         # This ensures it gets passed to qemu-kvm as a disk arg.
@@ -200,7 +197,7 @@ class Creator(object):
         finally:
             part.format.unmount()
             # pylint: disable=undefined-variable
-            tear_down_disk_images(b)
+            b.devicetree.tearDownDiskImages()
 
     def run(self):
         """Given disk images previously created by Creator.makeDrives and
diff --git a/tests/storage/cases/__init__.py b/tests/storage/cases/__init__.py
index b1bbe75..28314c0 100644
--- a/tests/storage/cases/__init__.py
+++ b/tests/storage/cases/__init__.py
@@ -21,17 +21,12 @@ import logging
 import os, sys
 import re
 
-# Can't import from a directory with a dash in its name.  This is good enough.
-execfile("/usr/share/doc/python-blivet/examples/common.py")
+import blivet
 
-# Set up logging before blivet or anaconda are imported.
-# pylint: disable=undefined-variable
-set_up_logging()
+blivet.util.set_up_logging()
 blivet_log = logging.getLogger("blivet")
 blivet_log.info(sys.argv[0])
 
-import blivet
-
 from pyanaconda.installclass import DefaultInstall
 from pyanaconda.kickstart import AnacondaKSHandler, AnacondaKSParser, doKickstartStorage
 from pykickstart.errors import KickstartError
@@ -152,7 +147,7 @@ class TestCaseComponent(object):
         self._blivet._bootloader = get_bootloader()
 
         for (name, size) in self.disksToCreate:
-            self._disks[name] = create_sparse_file(self._blivet, name, size)
+            self._disks[name] = blivet.util.create_sparse_tempfile(name, size)
             self._blivet.config.diskImages[name] = self._disks[name]
 
         self._blivet.reset()
@@ -164,7 +159,7 @@ class TestCaseComponent(object):
            the images get destroyed.
         """
         # pylint: disable=undefined-variable
-        tear_down_disk_images(self._blivet)
+        self._blivet.devicetree.tearDownDiskImages()
 
         for d in self._disks.values():
             os.unlink(d)
-- 
1.9.0



More information about the anaconda-patches mailing list