diff --git a/tests/clitest.py b/tests/clitest.py index ae33cba4..07e431ba 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -18,7 +18,7 @@ except ImportError: argcomplete = None from virtinst import log -from virtinst import unattended +from virtinst.install import unattended from tests import virtinstall, virtclone, virtconvert, virtxml from tests import utils diff --git a/tests/osdict.py b/tests/osdict.py index f2bfd817..eb0d4f86 100644 --- a/tests/osdict.py +++ b/tests/osdict.py @@ -8,7 +8,7 @@ import unittest from virtinst import Guest from virtinst import OSDB -from virtinst import urldetect +from virtinst.install import urldetect from tests import utils diff --git a/virtinst/__init__.py b/virtinst/__init__.py index 7403924d..d7f5ec55 100644 --- a/virtinst/__init__.py +++ b/virtinst/__init__.py @@ -57,7 +57,7 @@ from virtinst.storage import StoragePool, StorageVolume from virtinst.devices import * # pylint: disable=wildcard-import -from virtinst.installer import Installer +from virtinst.install.installer import Installer from virtinst.guest import Guest from virtinst.cloner import Cloner diff --git a/virtinst/cli.py b/virtinst/cli.py index cc13af20..27991129 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -27,7 +27,7 @@ from .logger import log from .nodedev import NodeDevice from .osdict import OSDB from .storage import StoragePool, StorageVolume -from .unattended import UnattendedData +from .install.unattended import UnattendedData ########################## diff --git a/virtinst/install/__init__.py b/virtinst/install/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/virtinst/installer.py b/virtinst/install/installer.py similarity index 99% rename from virtinst/installer.py rename to virtinst/install/installer.py index f86af334..a5c7a708 100644 --- a/virtinst/installer.py +++ b/virtinst/install/installer.py @@ -7,15 +7,15 @@ # See the COPYING file in the top-level directory. import os -from .logger import log -from . import progress from . import unattended -from .devices import DeviceDisk -from .domain import DomainOs -from .osdict import OSDB from .installertreemedia import InstallerTreeMedia from .installerinject import perform_cdrom_injections +from ..domain import DomainOs +from ..devices import DeviceDisk +from ..osdict import OSDB +from ..logger import log +from .. import progress def _make_testsuite_path(path): diff --git a/virtinst/installerinject.py b/virtinst/install/installerinject.py similarity index 99% rename from virtinst/installerinject.py rename to virtinst/install/installerinject.py index b38fe963..d7cfcfb4 100644 --- a/virtinst/installerinject.py +++ b/virtinst/install/installerinject.py @@ -9,7 +9,7 @@ import shutil import subprocess import tempfile -from .logger import log +from ..logger import log def _run_initrd_commands(initrd, tempdir): diff --git a/virtinst/installertreemedia.py b/virtinst/install/installertreemedia.py similarity index 98% rename from virtinst/installertreemedia.py rename to virtinst/install/installertreemedia.py index 7c9d8e93..6ed9ddec 100644 --- a/virtinst/installertreemedia.py +++ b/virtinst/install/installertreemedia.py @@ -6,14 +6,14 @@ import os -from . import progress from . import urldetect from . import urlfetcher -from .devices import DeviceDisk from .installerinject import perform_initrd_injections from .kernelupload import upload_kernel_initrd -from .logger import log -from .osdict import OSDB +from .. import progress +from ..devices import DeviceDisk +from ..logger import log +from ..osdict import OSDB # Enum of the various install media types we can have diff --git a/virtinst/kernelupload.py b/virtinst/install/kernelupload.py similarity index 97% rename from virtinst/kernelupload.py rename to virtinst/install/kernelupload.py index e4e2a83a..577ed543 100644 --- a/virtinst/kernelupload.py +++ b/virtinst/install/kernelupload.py @@ -6,10 +6,10 @@ import os -from . import progress -from .logger import log -from .devices import DeviceDisk -from .storage import StoragePool, StorageVolume +from .. import progress +from ..devices import DeviceDisk +from ..logger import log +from ..storage import StoragePool, StorageVolume def _build_pool(conn, meter, path): diff --git a/virtinst/unattended.py b/virtinst/install/unattended.py similarity index 99% rename from virtinst/unattended.py rename to virtinst/install/unattended.py index a0b6fc27..ea3f9066 100644 --- a/virtinst/unattended.py +++ b/virtinst/install/unattended.py @@ -14,7 +14,7 @@ import tempfile from gi.repository import Libosinfo -from .logger import log +from ..logger import log def _make_installconfig(script, osobj, unattended_data, arch, hostname, url): @@ -120,7 +120,7 @@ class OSInstallScript: """ @staticmethod def have_new_libosinfo(): - from .osdict import OSDB + from ..osdict import OSDB win7 = OSDB.lookup_os("win7") for script in win7.get_install_script_list(): diff --git a/virtinst/urldetect.py b/virtinst/install/urldetect.py similarity index 99% rename from virtinst/urldetect.py rename to virtinst/install/urldetect.py index cc5062a0..7969ad46 100644 --- a/virtinst/urldetect.py +++ b/virtinst/install/urldetect.py @@ -7,8 +7,8 @@ import configparser import re -from .logger import log -from .osdict import OSDB +from ..logger import log +from ..osdict import OSDB ############################################### @@ -187,8 +187,7 @@ class _SUSEContent(object): if line.startswith(prefix + " "): self.content_dict[prefix] = line.split(" ", 1)[1] - log.debug("SUSE content dict: %s", str(self.content_dict)) - + log.debug("SUSE content dict: %s", self.content_dict) self.tree_arch = self._get_tree_arch() self.product_name = self._get_product_name() self.product_version = self._get_product_version() diff --git a/virtinst/urlfetcher.py b/virtinst/install/urlfetcher.py similarity index 99% rename from virtinst/urlfetcher.py rename to virtinst/install/urlfetcher.py index 1ccaf93b..e48c801c 100644 --- a/virtinst/urlfetcher.py +++ b/virtinst/install/urlfetcher.py @@ -15,7 +15,7 @@ import urllib import requests -from .logger import log +from ..logger import log ############################## @@ -30,7 +30,7 @@ def _make_mock_url(url, filesyntax): if url.endswith("treeinfo"): # If the url is requesting treeinfo, give a fake treeinfo from # our testsuite data - fn = ("%s/../tests/cli-test-xml/fakerhel6tree/.treeinfo" % + fn = ("%s/../../tests/cli-test-xml/fakerhel6tree/.treeinfo" % os.path.abspath(os.path.dirname(__file__))) abspath = os.path.abspath(fn) else: