diff options
author | Cole Robinson <crobinso@redhat.com> | 2013-08-08 21:42:44 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-08-09 08:54:39 -0400 |
commit | 952708f5095d031d182eab7ad622b18ee36f5d6d (patch) | |
tree | 8f3d0bd69b01a3f5f48c06cdb22e55743e67a48c | |
parent | 01629d3f2caff39cef8de3ac0ddca9fb7ab43eb4 (diff) | |
download | virt-manager-952708f5095d031d182eab7ad622b18ee36f5d6d.tar.gz |
virtinst: Rename most files to be more sensible
- Lower case everything
- Virtual... -> device...
- A few other similar bits
-rw-r--r-- | tests/interface.py | 54 | ||||
-rw-r--r-- | tests/nodedev.py | 2 | ||||
-rw-r--r-- | tests/storage.py | 59 | ||||
-rw-r--r-- | tests/urltest.py | 22 | ||||
-rw-r--r-- | virtinst/__init__.py | 65 | ||||
-rw-r--r-- | virtinst/capabilities.py (renamed from virtinst/CapabilitiesParser.py) | 4 | ||||
-rw-r--r-- | virtinst/clock.py (renamed from virtinst/Clock.py) | 0 | ||||
-rw-r--r-- | virtinst/cloner.py (renamed from virtinst/CloneManager.py) | 0 | ||||
-rw-r--r-- | virtinst/cpu.py (renamed from virtinst/CPU.py) | 0 | ||||
-rw-r--r-- | virtinst/device.py (renamed from virtinst/VirtualDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/deviceaudio.py (renamed from virtinst/VirtualAudio.py) | 0 | ||||
-rw-r--r-- | virtinst/devicechar.py (renamed from virtinst/VirtualCharDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/devicecontroller.py (renamed from virtinst/VirtualController.py) | 0 | ||||
-rw-r--r-- | virtinst/devicedisk.py (renamed from virtinst/VirtualDisk.py) | 0 | ||||
-rw-r--r-- | virtinst/devicefilesystem.py (renamed from virtinst/VirtualFilesystem.py) | 0 | ||||
-rw-r--r-- | virtinst/devicegraphics.py (renamed from virtinst/VirtualGraphics.py) | 0 | ||||
-rw-r--r-- | virtinst/devicehostdev.py (renamed from virtinst/VirtualHostDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/deviceinput.py (renamed from virtinst/VirtualInputDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/deviceinterface.py (renamed from virtinst/VirtualNetworkInterface.py) | 0 | ||||
-rw-r--r-- | virtinst/devicememballoon.py (renamed from virtinst/VirtualMemballoon.py) | 0 | ||||
-rw-r--r-- | virtinst/deviceredirdev.py (renamed from virtinst/VirtualRedirDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/devicesmartcard.py (renamed from virtinst/VirtualSmartCardDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/devicetpm.py (renamed from virtinst/VirtualTPMDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/devicevideo.py (renamed from virtinst/VirtualVideoDevice.py) | 0 | ||||
-rw-r--r-- | virtinst/devicewatchdog.py (renamed from virtinst/VirtualWatchdog.py) | 0 | ||||
-rw-r--r-- | virtinst/distroinstaller.py (renamed from virtinst/DistroInstaller.py) | 10 | ||||
-rw-r--r-- | virtinst/domainfeatures.py (renamed from virtinst/DomainFeatures.py) | 0 | ||||
-rw-r--r-- | virtinst/domainnumatune.py (renamed from virtinst/DomainNumatune.py) | 0 | ||||
-rw-r--r-- | virtinst/guest.py (renamed from virtinst/Guest.py) | 0 | ||||
-rw-r--r-- | virtinst/installer.py (renamed from virtinst/Installer.py) | 0 | ||||
-rw-r--r-- | virtinst/interface.py (renamed from virtinst/Interface.py) | 0 | ||||
-rw-r--r-- | virtinst/nodedev.py (renamed from virtinst/NodeDeviceParser.py) | 0 | ||||
-rw-r--r-- | virtinst/seclabel.py (renamed from virtinst/Seclabel.py) | 0 | ||||
-rw-r--r-- | virtinst/storage.py (renamed from virtinst/Storage.py) | 0 | ||||
-rw-r--r-- | virtinst/urlfetcher.py (renamed from virtinst/OSDistro.py) | 5 |
35 files changed, 118 insertions, 103 deletions
diff --git a/tests/interface.py b/tests/interface.py index 25eb7f4c..ed332057 100644 --- a/tests/interface.py +++ b/tests/interface.py @@ -18,9 +18,7 @@ import os import unittest import logging -import virtinst.Interface -from virtinst.Interface import (Interface, InterfaceProtocol, - InterfaceProtocolIPAddress) +from virtinst import Interface from tests import utils conn = utils.open_testdriver() @@ -40,7 +38,7 @@ class TestInterfaces(unittest.TestCase): pass def build_interface(self, interface_type, name): - iclass = Interface.interface_class_for_type(interface_type) + iclass = Interface.Interface.interface_class_for_type(interface_type) iobj = iclass(conn, name) return iobj @@ -48,15 +46,15 @@ class TestInterfaces(unittest.TestCase): def set_general_params(self, iface_obj): iface_obj.mtu = 1501 iface_obj.macaddr = "AA:AA:AA:AA:AA:AA" - iface_obj.start_mode = Interface.INTERFACE_START_MODE_ONBOOT - iface_obj.protocols = [virtinst.Interface.InterfaceProtocolIPv4()] + iface_obj.start_mode = Interface.Interface.INTERFACE_START_MODE_ONBOOT + iface_obj.protocols = [Interface.InterfaceProtocolIPv4()] def add_child_interfaces(self, iface_obj): - if iface_obj.object_type == Interface.INTERFACE_TYPE_BRIDGE: + if iface_obj.object_type == Interface.Interface.INTERFACE_TYPE_BRIDGE: iface_obj.interfaces.append(vlan_iface) iface_obj.interfaces.append(bond_iface) iface_obj.interfaces.append(eth_iface1) - elif iface_obj.object_type == Interface.INTERFACE_TYPE_BOND: + elif iface_obj.object_type == Interface.Interface.INTERFACE_TYPE_BOND: iface_obj.interfaces.append(eth_iface1) iface_obj.interfaces.append(eth_iface2) iface_obj.interfaces.append(eth_iface3) @@ -79,7 +77,7 @@ class TestInterfaces(unittest.TestCase): # Bridge tests def testBridgeInterface(self): filename = "bridge" - obj = self.build_interface(Interface.INTERFACE_TYPE_BRIDGE, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_BRIDGE, "test-%s" % filename) self.add_child_interfaces(obj) @@ -90,27 +88,29 @@ class TestInterfaces(unittest.TestCase): def testBridgeInterfaceIP(self): filename = "bridge-ip" - obj = self.build_interface(Interface.INTERFACE_TYPE_BRIDGE, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_BRIDGE, "test-%s" % filename) self.add_child_interfaces(obj) # IPv4 proto - iface_ip1 = InterfaceProtocolIPAddress("129.63.1.2") - iface_ip2 = InterfaceProtocolIPAddress("255.255.255.0") - iface_proto1 = InterfaceProtocol.protocol_class_for_family( - InterfaceProtocol.INTERFACE_PROTOCOL_FAMILY_IPV4)() + iface_ip1 = Interface.InterfaceProtocolIPAddress("129.63.1.2") + iface_ip2 = Interface.InterfaceProtocolIPAddress("255.255.255.0") + iface_proto1 = Interface.InterfaceProtocol.protocol_class_for_family( + Interface.InterfaceProtocol.INTERFACE_PROTOCOL_FAMILY_IPV4)() iface_proto1.ips = [iface_ip1, iface_ip2] iface_proto1.gateway = "1.2.3.4" iface_proto1.dhcp = True iface_proto1.dhcp_peerdns = True # IPv6 proto - iface_ip3 = InterfaceProtocolIPAddress("fe99::215:58ff:fe6e:5", + iface_ip3 = Interface.InterfaceProtocolIPAddress( + "fe99::215:58ff:fe6e:5", prefix="32") - iface_ip4 = InterfaceProtocolIPAddress("fe80::215:58ff:fe6e:5", + iface_ip4 = Interface.InterfaceProtocolIPAddress( + "fe80::215:58ff:fe6e:5", prefix="64") - iface_proto2 = InterfaceProtocol.protocol_class_for_family( - InterfaceProtocol.INTERFACE_PROTOCOL_FAMILY_IPV6)() + iface_proto2 = Interface.InterfaceProtocol.protocol_class_for_family( + Interface.InterfaceProtocol.INTERFACE_PROTOCOL_FAMILY_IPV6)() iface_proto2.ips = [iface_ip3, iface_ip4] iface_proto2.gateway = "1.2.3.4" @@ -125,7 +125,7 @@ class TestInterfaces(unittest.TestCase): # Bond tests def testBondInterface(self): filename = "bond" - obj = self.build_interface(Interface.INTERFACE_TYPE_BOND, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_BOND, "test-%s" % filename) self.add_child_interfaces(obj) self.set_general_params(obj) @@ -134,7 +134,7 @@ class TestInterfaces(unittest.TestCase): def testBondInterfaceARP(self): filename = "bond-arp" - obj = self.build_interface(Interface.INTERFACE_TYPE_BOND, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_BOND, "test-%s" % filename) self.add_child_interfaces(obj) self.set_general_params(obj) @@ -148,7 +148,7 @@ class TestInterfaces(unittest.TestCase): def testBondInterfaceMII(self): filename = "bond-mii" - obj = self.build_interface(Interface.INTERFACE_TYPE_BOND, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_BOND, "test-%s" % filename) self.add_child_interfaces(obj) self.set_general_params(obj) @@ -164,25 +164,25 @@ class TestInterfaces(unittest.TestCase): # Ethernet tests def testEthernetInterface(self): filename = "ethernet" - obj = self.build_interface(Interface.INTERFACE_TYPE_ETHERNET, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_ETHERNET, "test-%s" % filename) self.define_xml(obj) def testEthernetManyParam(self): filename = "ethernet-params" - obj = self.build_interface(Interface.INTERFACE_TYPE_ETHERNET, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_ETHERNET, "test-%s" % filename) obj.mtu = 1234 obj.mac = "AA:BB:FF:FF:BB:AA" - obj.start_mode = Interface.INTERFACE_START_MODE_HOTPLUG + obj.start_mode = Interface.Interface.INTERFACE_START_MODE_HOTPLUG self.define_xml(obj) # VLAN tests def testVLANInterface(self): filename = "vlan" - obj = self.build_interface(Interface.INTERFACE_TYPE_VLAN, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_VLAN, "test-%s" % filename) obj.tag = "123" @@ -191,7 +191,7 @@ class TestInterfaces(unittest.TestCase): self.define_xml(obj) def testVLANInterfaceBusted(self): - obj = self.build_interface(Interface.INTERFACE_TYPE_VLAN, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_VLAN, "vlan1") try: @@ -205,7 +205,7 @@ class TestInterfaces(unittest.TestCase): # protocol_xml test def testEthernetProtocolInterface(self): filename = "ethernet-copy-proto" - obj = self.build_interface(Interface.INTERFACE_TYPE_ETHERNET, + obj = self.build_interface(Interface.Interface.INTERFACE_TYPE_ETHERNET, "test-%s" % filename) protoxml = (" <protocol family='ipv6'>\n" diff --git a/tests/nodedev.py b/tests/nodedev.py index c2920a89..ce0c7538 100644 --- a/tests/nodedev.py +++ b/tests/nodedev.py @@ -17,7 +17,7 @@ import os.path import unittest -import virtinst.NodeDeviceParser as nodeparse +from virtinst import NodeDeviceParser as nodeparse from virtinst import VirtualHostDevice from tests import utils diff --git a/tests/storage.py b/tests/storage.py index f680c318..99ee5921 100644 --- a/tests/storage.py +++ b/tests/storage.py @@ -17,8 +17,7 @@ import os import unittest -import virtinst.Storage -from virtinst.Storage import StoragePool, StorageVolume +from virtinst import Storage from tests import utils @@ -51,7 +50,8 @@ def _findFreePoolName(conn, namebase): while True: poolname = namebase + "-%d" % i try: - StorageVolume.lookup_pool_by_name(conn=conn, pool_name=poolname) + Storage.StorageVolume.lookup_pool_by_name(conn=conn, + pool_name=poolname) i += 1 except: return poolname @@ -59,7 +59,7 @@ def _findFreePoolName(conn, namebase): def createPool(conn, ptype, poolname=None, fmt=None, target_path=None, source_path=None, source_name=None, uuid=None, iqn=None): - poolclass = StoragePool.get_pool_class(ptype) + poolclass = Storage.StoragePool.get_pool_class(ptype) if poolname is None: poolname = _findFreePoolName(conn, str(ptype) + "-pool") @@ -97,7 +97,7 @@ def poolCompare(pool_inst): def createVol(conn, poolobj, volname=None, input_vol=None, clone_vol=None): - volclass = StorageVolume.get_volume_for_pool(pool_object=poolobj) + volclass = Storage.StorageVolume.get_volume_for_pool(pool_object=poolobj) if volname is None: volname = poolobj.name() + "-vol" @@ -117,7 +117,7 @@ def createVol(conn, poolobj, volname=None, input_vol=None, clone_vol=None): if input_vol: vol_inst.input_vol = input_vol elif clone_vol: - vol_inst = virtinst.Storage.CloneVolume(conn, volname, clone_vol) + vol_inst = Storage.CloneVolume(conn, volname, clone_vol) filename = os.path.join(basepath, vol_inst.name + ".xml") @@ -133,7 +133,8 @@ class TestStorage(unittest.TestCase): self.conn = utils.open_testdefault() def testDirPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_DIR, "pool-dir") + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_DIR, "pool-dir") invol = createVol(self.conn, poolobj) createVol(self.conn, poolobj, volname=invol.name() + "input", input_vol=invol) @@ -141,7 +142,8 @@ class TestStorage(unittest.TestCase): volname=invol.name() + "clone", clone_vol=invol) def testFSPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_FS, "pool-fs") + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_FS, "pool-fs") invol = createVol(self.conn, poolobj) createVol(self.conn, poolobj, volname=invol.name() + "input", input_vol=invol) @@ -149,7 +151,8 @@ class TestStorage(unittest.TestCase): volname=invol.name() + "clone", clone_vol=invol) def testNetFSPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_NETFS, "pool-netfs") + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_NETFS, "pool-netfs") invol = createVol(self.conn, poolobj) createVol(self.conn, poolobj, volname=invol.name() + "input", input_vol=invol) @@ -157,7 +160,8 @@ class TestStorage(unittest.TestCase): volname=invol.name() + "clone", clone_vol=invol) def testLVPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_LOGICAL, + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_LOGICAL, "pool-logical", target_path="/dev/pool-logical") invol = createVol(self.conn, poolobj) @@ -167,21 +171,24 @@ class TestStorage(unittest.TestCase): poolobj, volname=invol.name() + "clone", clone_vol=invol) # Test parsing source name for target path - createPool(self.conn, StoragePool.TYPE_LOGICAL, + createPool(self.conn, Storage.StoragePool.TYPE_LOGICAL, "pool-logical-target-srcname", target_path="/dev/vgfoobar") # Test with source name - createPool(self.conn, StoragePool.TYPE_LOGICAL, "pool-logical-srcname", + createPool(self.conn, + Storage.StoragePool.TYPE_LOGICAL, "pool-logical-srcname", source_name="vgname") # Test creating with many devices - createPool(self.conn, StoragePool.TYPE_LOGICAL, "pool-logical-manydev", + createPool(self.conn, + Storage.StoragePool.TYPE_LOGICAL, "pool-logical-manydev", source_path=["/tmp/path1", "/tmp/path2", "/tmp/path3"], target_path=None) def testDiskPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_DISK, + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_DISK, "pool-disk", fmt="dos") invol = createVol(self.conn, poolobj) createVol(self.conn, poolobj, @@ -190,22 +197,26 @@ class TestStorage(unittest.TestCase): volname=invol.name() + "clone", clone_vol=invol) def testISCSIPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_ISCSI, "pool-iscsi") + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_ISCSI, "pool-iscsi") # Not supported #volobj = createVol(poolobj) self.assertRaises(RuntimeError, createVol, self.conn, poolobj) - createPool(self.conn, StoragePool.TYPE_ISCSI, "pool-iscsi-iqn", + createPool(self.conn, + Storage.StoragePool.TYPE_ISCSI, "pool-iscsi-iqn", iqn="foo.bar.baz.iqn") def testSCSIPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_SCSI, "pool-scsi") + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_SCSI, "pool-scsi") # Not supported #volobj = createVol(poolobj) self.assertRaises(RuntimeError, createVol, self.conn, poolobj) def testMpathPool(self): - poolobj = createPool(self.conn, StoragePool.TYPE_MPATH, "pool-mpath") + poolobj = createPool(self.conn, + Storage.StoragePool.TYPE_MPATH, "pool-mpath") # Not supported #volobj = createVol(poolobj) self.assertRaises(RuntimeError, createVol, self.conn, poolobj) @@ -219,16 +230,16 @@ class TestStorage(unittest.TestCase): def testEnumerateLogical(self): name = "pool-logical-list" - lst = StoragePool.pool_list_from_sources(self.conn, name, - StoragePool.TYPE_LOGICAL) + lst = Storage.StoragePool.pool_list_from_sources(self.conn, name, + Storage.StoragePool.TYPE_LOGICAL) self._enumerateCompare(lst) def testEnumerateNetFS(self): name = "pool-netfs-list" host = "example.com" - lst = StoragePool.pool_list_from_sources(self.conn, name, - StoragePool.TYPE_NETFS, + lst = Storage.StoragePool.pool_list_from_sources(self.conn, name, + Storage.StoragePool.TYPE_NETFS, host=host) self._enumerateCompare(lst) @@ -236,8 +247,8 @@ class TestStorage(unittest.TestCase): name = "pool-iscsi-list" host = "example.com" - lst = StoragePool.pool_list_from_sources(self.conn, name, - StoragePool.TYPE_ISCSI, + lst = Storage.StoragePool.pool_list_from_sources(self.conn, name, + Storage.StoragePool.TYPE_ISCSI, host=host) self.assertTrue(len(lst) == 0) diff --git a/tests/urltest.py b/tests/urltest.py index dea9fedb..de2c76a1 100644 --- a/tests/urltest.py +++ b/tests/urltest.py @@ -23,14 +23,14 @@ import sys from tests import utils import virtinst -import virtinst.OSDistro as OSDistro -from virtinst.OSDistro import FedoraDistro -from virtinst.OSDistro import SuseDistro -from virtinst.OSDistro import DebianDistro -from virtinst.OSDistro import CentOSDistro -from virtinst.OSDistro import SLDistro -from virtinst.OSDistro import UbuntuDistro -from virtinst.OSDistro import MandrivaDistro +from virtinst import urlfetcher +from virtinst.urlfetcher import FedoraDistro +from virtinst.urlfetcher import SuseDistro +from virtinst.urlfetcher import DebianDistro +from virtinst.urlfetcher import CentOSDistro +from virtinst.urlfetcher import SLDistro +from virtinst.urlfetcher import UbuntuDistro +from virtinst.urlfetcher import MandrivaDistro import urlgrabber.progress @@ -238,7 +238,7 @@ class TestURLFetch(unittest.TestCase): def _fetchLocalMedia(self, mediapath): arch = platform.machine() - fetcher = OSDistro._fetcherForURI(mediapath, "/tmp") + fetcher = urlfetcher._fetcherForURI(mediapath, "/tmp") try: fetcher.prepareLocation() @@ -254,7 +254,7 @@ class TestURLFetch(unittest.TestCase): logging.debug("\nDistro='%s' arch='%s' url=%s", distname, arch, url) - fetcher = OSDistro._fetcherForURI(url, "/tmp") + fetcher = urlfetcher._fetcherForURI(url, "/tmp") try: fetcher.prepareLocation() except Exception, e: @@ -377,7 +377,7 @@ class TestURLFetch(unittest.TestCase): def _getStore(self, fetcher, url, _type, arch): for ignore in range(0, 10): try: - return OSDistro._storeForDistro(fetcher=fetcher, baseuri=url, + return urlfetcher._storeForDistro(fetcher=fetcher, baseuri=url, progresscb=self.meter, arch=arch, typ=_type) except Exception, e: diff --git a/virtinst/__init__.py b/virtinst/__init__.py index 6a6cc907..9fc3efbb 100644 --- a/virtinst/__init__.py +++ b/virtinst/__init__.py @@ -23,38 +23,43 @@ from virtinst import util from virtinst import support 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 -from virtinst.VirtualInputDevice import VirtualInputDevice -from virtinst.VirtualDisk import VirtualDisk -from virtinst.VirtualHostDevice import VirtualHostDevice -from virtinst.VirtualCharDevice import (VirtualChannelDevice, - VirtualConsoleDevice, - VirtualParallelDevice, - VirtualSerialDevice) -from virtinst.VirtualVideoDevice import VirtualVideoDevice -from virtinst.VirtualController import VirtualController -from virtinst.VirtualWatchdog import VirtualWatchdog -from virtinst.VirtualFilesystem import VirtualFilesystem -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, +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 + +import virtinst.storage as Storage +import virtinst.nodedev as NodeDeviceParser +import virtinst.capabilities as CapabilitiesParser +import virtinst.interface as Interface + +from virtinst.device import VirtualDevice +from virtinst.deviceinterface import VirtualNetworkInterface +from virtinst.devicegraphics import VirtualGraphics +from virtinst.deviceaudio import VirtualAudio +from virtinst.deviceinput import VirtualInputDevice +from virtinst.devicedisk import VirtualDisk +from virtinst.devicehostdev import VirtualHostDevice +from virtinst.devicechar import (VirtualChannelDevice, + VirtualConsoleDevice, + VirtualParallelDevice, + VirtualSerialDevice) +from virtinst.devicevideo import VirtualVideoDevice +from virtinst.devicecontroller import VirtualController +from virtinst.devicewatchdog import VirtualWatchdog +from virtinst.devicefilesystem import VirtualFilesystem +from virtinst.devicesmartcard import VirtualSmartCardDevice +from virtinst.deviceredirdev import VirtualRedirDevice +from virtinst.devicememballoon import VirtualMemballoon +from virtinst.devicetpm import VirtualTPMDevice + +from virtinst.installer import (ContainerInstaller, ImportInstaller, LiveCDInstaller, PXEInstaller, Installer) -from virtinst.DistroInstaller import DistroInstaller +from virtinst.distroinstaller import DistroInstaller -from virtinst.Guest import Guest -from virtinst.CloneManager import Cloner +from virtinst.guest import Guest +from virtinst.cloner import Cloner from virtinst.connection import VirtualConnection diff --git a/virtinst/CapabilitiesParser.py b/virtinst/capabilities.py index a2523b25..9611a579 100644 --- a/virtinst/CapabilitiesParser.py +++ b/virtinst/capabilities.py @@ -721,8 +721,8 @@ class Capabilities(object): return (guest, domain) def build_virtinst_guest(self, conn, guest, domain): - import virtinst - gobj = virtinst.Guest(conn) + from virtinst import Guest as VGuest + gobj = VGuest(conn) gobj.type = domain.hypervisor_type gobj.os.os_type = guest.os_type gobj.os.arch = guest.arch diff --git a/virtinst/Clock.py b/virtinst/clock.py index 62f6c0be..62f6c0be 100644 --- a/virtinst/Clock.py +++ b/virtinst/clock.py diff --git a/virtinst/CloneManager.py b/virtinst/cloner.py index 92e9c5fa..92e9c5fa 100644 --- a/virtinst/CloneManager.py +++ b/virtinst/cloner.py diff --git a/virtinst/CPU.py b/virtinst/cpu.py index af3744e4..af3744e4 100644 --- a/virtinst/CPU.py +++ b/virtinst/cpu.py diff --git a/virtinst/VirtualDevice.py b/virtinst/device.py index af78bf0f..af78bf0f 100644 --- a/virtinst/VirtualDevice.py +++ b/virtinst/device.py diff --git a/virtinst/VirtualAudio.py b/virtinst/deviceaudio.py index 6d8e1997..6d8e1997 100644 --- a/virtinst/VirtualAudio.py +++ b/virtinst/deviceaudio.py diff --git a/virtinst/VirtualCharDevice.py b/virtinst/devicechar.py index a6942744..a6942744 100644 --- a/virtinst/VirtualCharDevice.py +++ b/virtinst/devicechar.py diff --git a/virtinst/VirtualController.py b/virtinst/devicecontroller.py index 91cc84f7..91cc84f7 100644 --- a/virtinst/VirtualController.py +++ b/virtinst/devicecontroller.py diff --git a/virtinst/VirtualDisk.py b/virtinst/devicedisk.py index 7ec73228..7ec73228 100644 --- a/virtinst/VirtualDisk.py +++ b/virtinst/devicedisk.py diff --git a/virtinst/VirtualFilesystem.py b/virtinst/devicefilesystem.py index ef64f794..ef64f794 100644 --- a/virtinst/VirtualFilesystem.py +++ b/virtinst/devicefilesystem.py diff --git a/virtinst/VirtualGraphics.py b/virtinst/devicegraphics.py index 6a7c6e9b..6a7c6e9b 100644 --- a/virtinst/VirtualGraphics.py +++ b/virtinst/devicegraphics.py diff --git a/virtinst/VirtualHostDevice.py b/virtinst/devicehostdev.py index 93f1f15f..93f1f15f 100644 --- a/virtinst/VirtualHostDevice.py +++ b/virtinst/devicehostdev.py diff --git a/virtinst/VirtualInputDevice.py b/virtinst/deviceinput.py index 46c9dca2..46c9dca2 100644 --- a/virtinst/VirtualInputDevice.py +++ b/virtinst/deviceinput.py diff --git a/virtinst/VirtualNetworkInterface.py b/virtinst/deviceinterface.py index 3e59d277..3e59d277 100644 --- a/virtinst/VirtualNetworkInterface.py +++ b/virtinst/deviceinterface.py diff --git a/virtinst/VirtualMemballoon.py b/virtinst/devicememballoon.py index 8f2f65d9..8f2f65d9 100644 --- a/virtinst/VirtualMemballoon.py +++ b/virtinst/devicememballoon.py diff --git a/virtinst/VirtualRedirDevice.py b/virtinst/deviceredirdev.py index 4b1d40c7..4b1d40c7 100644 --- a/virtinst/VirtualRedirDevice.py +++ b/virtinst/deviceredirdev.py diff --git a/virtinst/VirtualSmartCardDevice.py b/virtinst/devicesmartcard.py index 111b0ea6..111b0ea6 100644 --- a/virtinst/VirtualSmartCardDevice.py +++ b/virtinst/devicesmartcard.py diff --git a/virtinst/VirtualTPMDevice.py b/virtinst/devicetpm.py index 5f28837c..5f28837c 100644 --- a/virtinst/VirtualTPMDevice.py +++ b/virtinst/devicetpm.py diff --git a/virtinst/VirtualVideoDevice.py b/virtinst/devicevideo.py index efabdb5d..efabdb5d 100644 --- a/virtinst/VirtualVideoDevice.py +++ b/virtinst/devicevideo.py diff --git a/virtinst/VirtualWatchdog.py b/virtinst/devicewatchdog.py index 59d9add2..59d9add2 100644 --- a/virtinst/VirtualWatchdog.py +++ b/virtinst/devicewatchdog.py diff --git a/virtinst/DistroInstaller.py b/virtinst/distroinstaller.py index e4cfd94c..5083a80b 100644 --- a/virtinst/DistroInstaller.py +++ b/virtinst/distroinstaller.py @@ -30,7 +30,7 @@ from virtinst import Storage from virtinst import util from virtinst import Installer from virtinst import VirtualDisk -from virtinst import OSDistro +from virtinst import urlfetcher def _is_url(url, is_local): @@ -254,7 +254,7 @@ class DistroInstaller(Installer): transient = not self.livecd if not self._location_is_path: (store_ignore, os_type_ignore, - os_variant_ignore, media) = OSDistro.getBootDisk(guest, + os_variant_ignore, media) = urlfetcher.getBootDisk(guest, self.location, meter, scratchdir) @@ -284,7 +284,7 @@ class DistroInstaller(Installer): if self._install_kernel and not self.scratchdir_required(): return disk - ignore, os_type, os_variant, media = OSDistro.getKernel(guest, + ignore, os_type, os_variant, media = urlfetcher.getKernel(guest, self.location, meter, scratchdir, guest.os.os_type) @@ -398,12 +398,12 @@ class DistroInstaller(Installer): return True # This will throw an error for us - OSDistro.detectMediaDistro(self.location, arch) + urlfetcher.detectMediaDistro(self.location, arch) return True def detect_distro(self, arch): try: - dist_info = OSDistro.detectMediaDistro(self.location, arch) + dist_info = urlfetcher.detectMediaDistro(self.location, arch) except: logging.exception("Error attempting to detect distro.") return (None, None) diff --git a/virtinst/DomainFeatures.py b/virtinst/domainfeatures.py index b2934b8f..b2934b8f 100644 --- a/virtinst/DomainFeatures.py +++ b/virtinst/domainfeatures.py diff --git a/virtinst/DomainNumatune.py b/virtinst/domainnumatune.py index 356d82bf..356d82bf 100644 --- a/virtinst/DomainNumatune.py +++ b/virtinst/domainnumatune.py diff --git a/virtinst/Guest.py b/virtinst/guest.py index 35b6d4ed..35b6d4ed 100644 --- a/virtinst/Guest.py +++ b/virtinst/guest.py diff --git a/virtinst/Installer.py b/virtinst/installer.py index 39562e64..39562e64 100644 --- a/virtinst/Installer.py +++ b/virtinst/installer.py diff --git a/virtinst/Interface.py b/virtinst/interface.py index 8f70d01e..8f70d01e 100644 --- a/virtinst/Interface.py +++ b/virtinst/interface.py diff --git a/virtinst/NodeDeviceParser.py b/virtinst/nodedev.py index 86dc0354..86dc0354 100644 --- a/virtinst/NodeDeviceParser.py +++ b/virtinst/nodedev.py diff --git a/virtinst/Seclabel.py b/virtinst/seclabel.py index 43e5c117..43e5c117 100644 --- a/virtinst/Seclabel.py +++ b/virtinst/seclabel.py diff --git a/virtinst/Storage.py b/virtinst/storage.py index e0b0ef17..e0b0ef17 100644 --- a/virtinst/Storage.py +++ b/virtinst/storage.py diff --git a/virtinst/OSDistro.py b/virtinst/urlfetcher.py index 4cd80b85..2acd3ac0 100644 --- a/virtinst/OSDistro.py +++ b/virtinst/urlfetcher.py @@ -34,7 +34,6 @@ import urlparse import urlgrabber.grabber as grabber -import virtinst from virtinst import osdict from virtinst import util @@ -253,8 +252,8 @@ def _storeForDistro(fetcher, baseuri, typ, progresscb, arch, distro=None, skip_treeinfo = False logging.debug("Attempting to detect distro:") - dist = virtinst.OSDistro.distroFromTreeinfo(fetcher, progresscb, baseuri, - arch, typ, scratchdir) + dist = distroFromTreeinfo(fetcher, progresscb, baseuri, + arch, typ, scratchdir) if dist: return dist skip_treeinfo = True |