diff --git a/tests/clitest.py b/tests/clitest.py index ae33cba4b..07e431bae 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 f2bfd8174..eb0d4f864 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 7403924dc..d7f5ec552 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 cc13af20c..27991129f 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 000000000..e69de29bb 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 f86af3346..a5c7a708f 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 b38fe9633..d7cfcfb42 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 7c9d8e932..6ed9ddec4 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 e4e2a83a9..577ed5434 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 a0b6fc272..ea3f90665 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 cc5062a0b..7969ad465 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 1ccaf93ba..e48c801c1 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: