mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
virtinst: Rename most files to be more sensible
- Lower case everything - Virtual... -> device... - A few other similar bits
This commit is contained in:
parent
01629d3f2c
commit
952708f509
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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.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
|
||||
import virtinst.storage as Storage
|
||||
import virtinst.nodedev as NodeDeviceParser
|
||||
import virtinst.capabilities as CapabilitiesParser
|
||||
import virtinst.interface as Interface
|
||||
|
||||
from virtinst.Installer import (ContainerInstaller, ImportInstaller,
|
||||
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
|
||||
|
@ -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
|
@ -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)
|
@ -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
|
Loading…
Reference in New Issue
Block a user