virtinst: Fix import ordering to standardize on relative imports

Kind of annoying that some imports were directly from files while
some were from the __init__.py convenience bits.
This commit is contained in:
Cole Robinson 2013-08-08 20:47:17 -04:00
parent 071860f9c0
commit accff84ecc
24 changed files with 58 additions and 46 deletions

View File

@ -14,9 +14,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import os.path
import os
import unittest
import virtinst.CapabilitiesParser as capabilities
from virtinst import CapabilitiesParser as capabilities
def build_host_feature_dict(feature_list):

View File

@ -27,8 +27,8 @@ import urlgrabber.progress as progress
import libvirt
from virtinst import Guest
from virtinst.VirtualNetworkInterface import VirtualNetworkInterface
from virtinst.VirtualDisk import VirtualDisk
from virtinst import VirtualNetworkInterface
from virtinst import VirtualDisk
from virtinst import Storage
from virtinst import util

View File

@ -29,7 +29,7 @@ from virtinst import support
from virtinst import Storage
from virtinst import util
from virtinst import Installer
from virtinst.VirtualDisk import VirtualDisk
from virtinst import VirtualDisk
from virtinst import OSDistro
@ -238,9 +238,9 @@ def _upload_media(conn, scratchdir, system_scratchdir,
class DistroInstaller(Installer.Installer):
class DistroInstaller(Installer):
def __init__(self, *args, **kwargs):
Installer.Installer.__init__(self, *args, **kwargs)
Installer.__init__(self, *args, **kwargs)
self.livecd = False
self._location_is_path = True

View File

@ -30,15 +30,15 @@ import libvirt
import virtinst
from virtinst import util
from virtinst import support
from virtinst.osxml import OSXML
from virtinst import OSXML
from virtinst import VirtualDisk
from virtinst import VirtualDevice
from virtinst import Clock
from virtinst import Seclabel
from virtinst import CPU
from virtinst import DomainNumatune
from virtinst import DomainFeatures
from virtinst.xmlbuilder import XMLBuilder, XMLProperty
from virtinst.VirtualDisk import VirtualDisk
from virtinst.VirtualDevice import VirtualDevice
from virtinst.Clock import Clock
from virtinst.Seclabel import Seclabel
from virtinst.CPU import CPU
from virtinst.DomainNumatune import DomainNumatune
from virtinst.DomainFeatures import DomainFeatures
from virtinst import osdict

View File

@ -23,17 +23,17 @@ import os
from virtinst import Installer
from virtinst import ImageParser
from virtinst import CapabilitiesParser
from virtinst.VirtualDisk import VirtualDisk
from virtinst import VirtualDisk
class ImageInstaller(Installer.Installer):
class ImageInstaller(Installer):
"""
Installer for virt-image-based guests
"""
_has_install_phase = False
def __init__(self, conn, image, boot_index=None):
Installer.Installer.__init__(self, conn)
Installer.__init__(self, conn)
self._image = image

View File

@ -17,12 +17,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst import util
import libvirt
import logging
# class USBDevice
import libvirt
from virtinst import util
# class USBDevice
CAPABILITY_TYPE_SYSTEM = "system"
CAPABILITY_TYPE_NET = "net"
CAPABILITY_TYPE_PCI = "pci"

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -31,7 +31,7 @@ import urlgrabber.progress as progress
import virtinst
from virtinst import diskbackend
from virtinst import util
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -19,7 +19,7 @@
import os
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -19,7 +19,7 @@
import os
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -17,9 +17,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst.xmlbuilder import XMLProperty
from virtinst import VirtualDevice
from virtinst import NodeDeviceParser
from virtinst.xmlbuilder import XMLProperty
class VirtualHostDevice(VirtualDevice):

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -21,7 +21,7 @@ import logging
import random
from virtinst import util
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLBuilder, XMLProperty

View File

@ -19,8 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -22,7 +22,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
from virtinst.xmlbuilder import XMLProperty

View File

@ -19,10 +19,17 @@ enable_rhel_defaults = not cliconfig.rhel_enable_unsupported_opts
cliutils.setup_i18n()
# Public imports
from virtinst import util
from virtinst import support
from virtinst.Guest import Guest
from virtinst.osxml import OSXML
from virtinst.DomainFeatures import DomainFeatures
from virtinst.DomainNumatune import DomainNumatune
from virtinst.Clock import Clock
from virtinst.CPU import CPU, CPUFeature
from virtinst.Seclabel import Seclabel
from virtinst.VirtualDevice import VirtualDevice
from virtinst.VirtualNetworkInterface import VirtualNetworkInterface
from virtinst.VirtualGraphics import VirtualGraphics
from virtinst.VirtualAudio import VirtualAudio
@ -41,12 +48,14 @@ from virtinst.VirtualSmartCardDevice import VirtualSmartCardDevice
from virtinst.VirtualRedirDevice import VirtualRedirDevice
from virtinst.VirtualMemballoon import VirtualMemballoon
from virtinst.VirtualTPMDevice import VirtualTPMDevice
from virtinst.Installer import (ContainerInstaller, ImportInstaller,
LiveCDInstaller, PXEInstaller, Installer)
from virtinst.DistroInstaller import DistroInstaller
from virtinst.ImageInstaller import ImageInstaller
from virtinst.Installer import (ContainerInstaller, ImportInstaller,
LiveCDInstaller, PXEInstaller)
from virtinst.Guest import Guest
from virtinst.CloneManager import Cloner
from virtinst.Clock import Clock
from virtinst.CPU import CPU, CPUFeature
from virtinst.Seclabel import Seclabel
from virtinst.connection import VirtualConnection

View File

@ -20,7 +20,7 @@
# MA 02110-1301 USA.
from virtinst import support
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualDevice
HV_ALL = "all"

View File

@ -26,6 +26,7 @@ import libxml2
from virtinst import util
# pylint: disable=W0212
# This whole file is calling around into non-public functions that we
# don't want regular API users to touch