Remove all relative imports

We also drop VirtualDevice from the 'public' virtinst API, since there
are better ways to get its info.
This commit is contained in:
Cole Robinson 2013-04-10 19:48:07 -04:00
parent aead0135b0
commit c5e45ae448
95 changed files with 284 additions and 305 deletions

View File

@ -38,19 +38,3 @@ if utils.get_debug():
rootLogger.setLevel(logging.DEBUG)
else:
rootLogger.setLevel(logging.ERROR)
# Have imports down here so they get the benefit of logging setup etc.
import capabilities
import clitest
import clonetest
import image
import interface
import nodedev
import storage
import support
import urltest
import validation
import virtconvtest
import xmlconfig
import xmlparse

View File

@ -27,8 +27,8 @@ import StringIO
import virtinst.cli
from scriptimports import virtinstall, virtimage, virtclone, virtconvert
import utils
from tests.scriptimports import virtinstall, virtimage, virtclone, virtconvert
from tests import utils
os.environ["VIRTCONV_TEST_NO_DISK_CONVERSION"] = "1"
os.environ["LANG"] = "en_US.UTF-8"

View File

@ -18,7 +18,7 @@ import unittest
import os
import logging
import utils
from tests import utils
from virtinst import CloneManager
CloneDesign = CloneManager.CloneDesign

View File

@ -21,7 +21,7 @@ import virtinst.cli
import virtinst.ImageParser
import os
import utils
from tests import utils
qemuuri = "__virtinst_test__test:///default,caps=%s/tests/capabilities-xml/capabilities-kvm.xml,qemu,predictable" % os.getcwd()

View File

@ -21,7 +21,7 @@ import logging
import virtinst.Interface
from virtinst.Interface import (Interface, InterfaceProtocol,
InterfaceProtocolIPAddress)
import utils
from tests import utils
conn = utils.open_testdriver()
datadir = "tests/interface-xml"

View File

@ -20,7 +20,7 @@ import unittest
import virtinst.NodeDeviceParser as nodeparse
from virtinst import VirtualHostDevice
import utils
from tests import utils
conn = utils.open_testdriver()

View File

@ -19,7 +19,7 @@ import unittest
import virtinst.Storage
from virtinst.Storage import StoragePool, StorageVolume
import utils
from tests import utils
import libvirt

View File

@ -18,7 +18,7 @@ import unittest
from virtinst import support
import utils
from tests import utils
conn = utils.open_testdriver()

View File

@ -21,7 +21,7 @@ import re
import platform
import sys
import utils
from tests import utils
import virtinst
import virtinst.OSDistro as OSDistro
from virtinst.OSDistro import FedoraDistro

View File

@ -18,7 +18,7 @@ import virtinst
from virtinst import VirtualDisk
from virtinst import Interface
import utils
from tests import utils
import unittest
import logging

View File

@ -18,7 +18,7 @@ import unittest
import virtconv
import os
import glob
import utils
from tests import utils
BASE = "tests/virtconv-files"

View File

@ -32,7 +32,7 @@ from virtinst import VirtualController
from virtinst import VirtualWatchdog
from virtinst import VirtualInputDevice
from virtinst import VirtualMemballoon
import utils
from tests import utils
_testconn = utils.open_testdriver()
_kvmconn = utils.open_testkvmdriver()

View File

@ -20,7 +20,7 @@ import traceback
import virtinst
import utils
from tests import utils
conn = utils.open_testdriver()
kvmconn = utils.open_testkvmdriver()

View File

@ -35,7 +35,7 @@ import virtinst.CapabilitiesParser
import virtinst.cli as cli
import virtinst.util as util
from virtinst import uriutil
from virtinst.VirtualDevice import VirtualDevice
from virtinst import VirtualCharDevice
from virtinst.cli import fail, print_stdout, print_stderr
@ -510,13 +510,13 @@ def build_guest_instance(conn, options):
get_watchdog(options.watchdog, guest)
get_filesystems(options.filesystems, guest)
cli.get_sound(options.sound, options.soundhw, guest)
get_chardevs(VirtualDevice.VIRTUAL_DEV_SERIAL, options.serials,
get_chardevs(VirtualCharDevice.VIRTUAL_DEV_SERIAL, options.serials,
guest, cli.parse_serial)
get_chardevs(VirtualDevice.VIRTUAL_DEV_PARALLEL, options.parallels,
get_chardevs(VirtualCharDevice.VIRTUAL_DEV_PARALLEL, options.parallels,
guest, cli.parse_parallel)
get_chardevs(VirtualDevice.VIRTUAL_DEV_CHANNEL, options.channels,
get_chardevs(VirtualCharDevice.VIRTUAL_DEV_CHANNEL, options.channels,
guest, cli.parse_channel)
get_chardevs(VirtualDevice.VIRTUAL_DEV_CONSOLE, options.consoles,
get_chardevs(VirtualCharDevice.VIRTUAL_DEV_CONSOLE, options.consoles,
guest, cli.parse_console)
cli.get_hostdevs(options.hostdevs, guest)
cli.get_smartcard(guest, options.smartcard)

View File

@ -25,7 +25,7 @@ from gi.repository import Gtk
from gi.repository import Gdk
import virtinst
from virtinst import (VirtualCharDevice, VirtualDevice,
from virtinst import (VirtualCharDevice,
VirtualVideoDevice, VirtualWatchdog,
VirtualFilesystem, VirtualSmartCardDevice,
VirtualRedirDevice)
@ -976,10 +976,10 @@ class vmmAddHardware(vmmGObjectUI):
label = row[5]
if label == "parallel":
return VirtualDevice.VIRTUAL_DEV_PARALLEL
return VirtualCharDevice.VIRTUAL_DEV_PARALLEL
elif label == "channel":
return VirtualDevice.VIRTUAL_DEV_CHANNEL
return VirtualDevice.VIRTUAL_DEV_SERIAL
return VirtualCharDevice.VIRTUAL_DEV_CHANNEL
return VirtualCharDevice.VIRTUAL_DEV_SERIAL
def dev_to_title(self, page):
if page == PAGE_ERROR:

View File

@ -16,4 +16,4 @@
# MA 02110-1301, USA. A copy of the GNU General Public License is
# also available at http://www.gnu.org/copyleft/gpl.html.
from nodeadmin import NodeAdmin
from virtManagerTui.nodeadmin import NodeAdmin

View File

@ -20,9 +20,9 @@
import snack
import os
from vmmconfigscreen import VmmTuiConfigScreen
from createmeter import CreateMeter
from domainconfig import DomainConfig
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.createmeter import CreateMeter
from virtManagerTui.domainconfig import DomainConfig
from virtinst import Guest

View File

@ -18,7 +18,7 @@
import snack
from vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
DETAILS_PAGE = 1
CONFIRM_PAGE = 2

View File

@ -25,8 +25,8 @@ import ipaddr
import logging
import re
from vmmconfigscreen import VmmTuiConfigScreen
from networkconfig import NetworkConfig
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.networkconfig import NetworkConfig
NETWORK_NAME_PAGE = 1
IPV4_ADDRESS_PAGE = 2

View File

@ -23,8 +23,8 @@ from snack import RadioBar
from newt_syrup import utils
from vmmconfigscreen import VmmTuiConfigScreen
from poolconfig import PoolConfig
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.poolconfig import PoolConfig
from virtinst import Storage
POOL_NAME_PAGE = 1

View File

@ -18,9 +18,9 @@
import snack
from createmeter import CreateMeter
from storagelistconfigscreen import StorageListConfigScreen
from volumeconfig import StorageVolumeConfig
from virtManagerTui.createmeter import CreateMeter
from virtManagerTui.storagelistconfigscreen import StorageListConfigScreen
from virtManagerTui.volumeconfig import StorageVolumeConfig
from newt_syrup import utils

View File

@ -19,7 +19,7 @@
import snack
import logging
from hostlistconfigscreen import HostListConfigScreen
from virtManagerTui.hostlistconfigscreen import HostListConfigScreen
CONNECTION_LIST_PAGE = 1
CONNECTED_PAGE = 2

View File

@ -19,7 +19,7 @@
import snack
from newt_syrup.configscreen import ConfigScreen
from userworker import UserWorker
from virtManagerTui.userworker import UserWorker
import libuser

View File

@ -18,7 +18,7 @@
import snack
from vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
class DomainListConfigScreen(VmmTuiConfigScreen):
'''Provides a base class for all config screens that require a domain list.'''

View File

@ -18,7 +18,7 @@
import snack
from vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
class HostListConfigScreen(VmmTuiConfigScreen):
'''Provides a base class for working with lists of libvirt hosts.'''

View File

@ -18,9 +18,9 @@
from newt_syrup.menuscreen import MenuScreen
from changehost import ChangeHost
from addhost import AddHost
from removehost import RemoveHost
from virtManagerTui.changehost import ChangeHost
from virtManagerTui.addhost import AddHost
from virtManagerTui.removehost import RemoveHost
SELECT_HOST = 1
ADD_HOST = 2

View File

@ -24,7 +24,7 @@ import libvirt
from virtManager.connection import vmmConnection
from domainconfig import DomainConfig
from virtManagerTui.domainconfig import DomainConfig
DEFAULT_POOL_TARGET_PATH = "/var/lib/libvirt/images"
DEFAULT_URL = "qemu:///system"

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
import snack
from domainlistconfigscreen import DomainListConfigScreen
from virtManagerTui.domainlistconfigscreen import DomainListConfigScreen
class ListDomainsConfigScreen(DomainListConfigScreen):
LIST_PAGE = 1

View File

@ -17,7 +17,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
from snack import Label
from networklistconfigscreen import NetworkListConfigScreen
from virtManagerTui.networklistconfigscreen import NetworkListConfigScreen
import ipaddr
LIST_PAGE = 1

View File

@ -19,7 +19,7 @@
from snack import Label
from snack import Listbox
from storagelistconfigscreen import StorageListConfigScreen
from virtManagerTui.storagelistconfigscreen import StorageListConfigScreen
from newt_syrup import utils

View File

@ -18,10 +18,10 @@
from newt_syrup.menuscreen import MenuScreen
from nodemenu import NodeMenu
from netmenu import NetworkMenu
from storagemenu import StoragePoolMenu
from hostmenu import HostMenu
from virtManagerTui.nodemenu import NodeMenu
from virtManagerTui.netmenu import NetworkMenu
from virtManagerTui.storagemenu import StoragePoolMenu
from virtManagerTui.hostmenu import HostMenu
NODE_MENU = 1
NETWORK_MENU = 2

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
import snack
from domainlistconfigscreen import DomainListConfigScreen
from virtManagerTui.domainlistconfigscreen import DomainListConfigScreen
LIST_DOMAINS = 1
SELECT_TARGET = 2

View File

@ -18,11 +18,11 @@
from newt_syrup.menuscreen import MenuScreen
from addnetwork import AddNetwork
from startnetwork import StartNetwork
from stopnetwork import StopNetwork
from removenetwork import RemoveNetwork
from listnetworks import ListNetworks
from virtManagerTui.addnetwork import AddNetwork
from virtManagerTui.startnetwork import StartNetwork
from virtManagerTui.stopnetwork import StopNetwork
from virtManagerTui.removenetwork import RemoveNetwork
from virtManagerTui.listnetworks import ListNetworks
ADD_NETWORK = 1
START_NETWORK = 2

View File

@ -18,7 +18,7 @@
import snack
from vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
class NetworkListConfigScreen(VmmTuiConfigScreen):
'''Provides a base class for all config screens that require a network list.'''

View File

@ -19,7 +19,7 @@
import sys
from mainmenu import MainMenu
from virtManagerTui.mainmenu import MainMenu
def NodeAdmin():
MainMenu()

View File

@ -18,14 +18,14 @@
from newt_syrup.menuscreen import MenuScreen
from adddomain import AddDomain
from startdomain import StartDomain
from stopdomain import StopDomain
from pausedomain import PauseDomain
from removedomain import RemoveDomain
from listdomains import ListDomains
from migratedomain import MigrateDomain
from createuser import CreateUser
from virtManagerTui.adddomain import AddDomain
from virtManagerTui.startdomain import StartDomain
from virtManagerTui.stopdomain import StopDomain
from virtManagerTui.pausedomain import PauseDomain
from virtManagerTui.removedomain import RemoveDomain
from virtManagerTui.listdomains import ListDomains
from virtManagerTui.migratedomain import MigrateDomain
from virtManagerTui.createuser import CreateUser
ADD_DOMAIN = 1
START_DOMAIN = 2

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
import snack
from domainlistconfigscreen import DomainListConfigScreen
from virtManagerTui.domainlistconfigscreen import DomainListConfigScreen
class PauseDomainConfigScreen(DomainListConfigScreen):
LIST_PAGE = 1

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
import snack
from domainlistconfigscreen import DomainListConfigScreen
from virtManagerTui.domainlistconfigscreen import DomainListConfigScreen
class RemoveDomainConfigScreen(DomainListConfigScreen):
LIST_PAGE = 1

View File

@ -18,7 +18,7 @@
import snack
from hostlistconfigscreen import HostListConfigScreen
from virtManagerTui.hostlistconfigscreen import HostListConfigScreen
SELECT_HOST_PAGE = 1
CONFIRM_REMOVE_PAGE = 2

View File

@ -19,7 +19,7 @@
from snack import Checkbox
from snack import Label
from networklistconfigscreen import NetworkListConfigScreen
from virtManagerTui.networklistconfigscreen import NetworkListConfigScreen
LIST_PAGE = 1
CONFIRM_PAGE = 2

View File

@ -20,7 +20,7 @@
from snack import Checkbox
from snack import Label
from storagelistconfigscreen import StorageListConfigScreen
from virtManagerTui.storagelistconfigscreen import StorageListConfigScreen
LIST_POOLS_PAGE = 1
CONFIRM_PAGE = 2

View File

@ -18,8 +18,8 @@
import snack
from storagelistconfigscreen import StorageListConfigScreen
from volumeconfig import StorageVolumeConfig
from virtManagerTui.storagelistconfigscreen import StorageListConfigScreen
from virtManagerTui.volumeconfig import StorageVolumeConfig
SELECT_POOL_PAGE = 1
SELECT_VOLUME_PAGE = 2

View File

@ -19,7 +19,7 @@
import snack
from domainlistconfigscreen import DomainListConfigScreen
from virtManagerTui.domainlistconfigscreen import DomainListConfigScreen
class StartDomainConfigScreen(DomainListConfigScreen):
LIST_PAGE = 1

View File

@ -19,7 +19,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
from snack import Label
from networklistconfigscreen import NetworkListConfigScreen
from virtManagerTui.networklistconfigscreen import NetworkListConfigScreen
LIST_PAGE = 1
START_PAGE = 2

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
from snack import Label
from storagelistconfigscreen import StorageListConfigScreen
from virtManagerTui.storagelistconfigscreen import StorageListConfigScreen
LIST_POOLS_PAGE = 1
FINAL_PAGE = 2

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
import snack
from domainlistconfigscreen import DomainListConfigScreen
from virtManagerTui.domainlistconfigscreen import DomainListConfigScreen
class StopDomainConfigScreen(DomainListConfigScreen):
LIST_PAGE = 1

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
from snack import Label
from networklistconfigscreen import NetworkListConfigScreen
from virtManagerTui.networklistconfigscreen import NetworkListConfigScreen
import logging
LIST_PAGE = 1

View File

@ -18,7 +18,7 @@
# also available at http://www.gnu.org/copyleft/gpl.html.
from snack import Label
from storagelistconfigscreen import StorageListConfigScreen
from virtManagerTui.storagelistconfigscreen import StorageListConfigScreen
LIST_POOLS_PAGE = 1
FINAL_PAGE = 2

View File

@ -18,7 +18,7 @@
import snack
from vmmconfigscreen import VmmTuiConfigScreen
from virtManagerTui.vmmconfigscreen import VmmTuiConfigScreen
class StorageListConfigScreen(VmmTuiConfigScreen):
'''Provides a base class for any configuration screen that deals with storage pool lists.'''

View File

@ -18,13 +18,13 @@
from newt_syrup.menuscreen import MenuScreen
from addpool import AddStoragePool
from startpool import StartStoragePool
from stoppool import StopStoragePool
from removepool import RemoveStoragePool
from addvolume import AddStorageVolume
from removevolume import RemoveStorageVolume
from listpools import ListStoragePools
from virtManagerTui.addpool import AddStoragePool
from virtManagerTui.startpool import StartStoragePool
from virtManagerTui.stoppool import StopStoragePool
from virtManagerTui.removepool import RemoveStoragePool
from virtManagerTui.addvolume import AddStorageVolume
from virtManagerTui.removevolume import RemoveStorageVolume
from virtManagerTui.listpools import ListStoragePools
ADD_POOL = 1
START_POOL = 2

View File

@ -22,7 +22,7 @@ from snack import Label
from types import StringType
from newt_syrup import configscreen
from libvirtworker import LibvirtWorker, VirtManagerConfig
from virtManagerTui.libvirtworker import LibvirtWorker, VirtManagerConfig
BACK_BUTTON = "back"
NEXT_BUTTON = "next"

View File

@ -17,9 +17,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import util
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import util
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
class Boot(XMLBuilderDomain.XMLBuilderDomain):
"""

View File

@ -17,8 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
import libxml2

View File

@ -21,7 +21,7 @@
import re
import util
from virtinst import util
class CapabilitiesParserException(Exception):
def __init__(self, msg):

View File

@ -17,8 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
class Clock(XMLBuilderDomain.XMLBuilderDomain):
"""

View File

@ -40,11 +40,11 @@ import os
import urlgrabber.progress as progress
import libvirt
import Guest
from VirtualNetworkInterface import VirtualNetworkInterface
from VirtualDisk import VirtualDisk
from virtinst import Guest
from virtinst.VirtualNetworkInterface import VirtualNetworkInterface
from virtinst.VirtualDisk import VirtualDisk
from virtinst import Storage
import util
from virtinst import util
def _listify(val):
"""
@ -150,7 +150,7 @@ class CloneDesign(object):
self.CLONE_POLICY_NO_EMPTYMEDIA]
# Throwaway guest to use for easy validation
self._valid_guest = Guest.Guest(conn=conn)
self._valid_guest = Guest(conn=conn)
# Generate a random UUID at the start
self.clone_uuid = util.generate_uuid(conn)
@ -402,7 +402,7 @@ class CloneDesign(object):
logging.debug("Original XML:\n%s", self.original_xml)
self._guest = Guest.Guest(conn=self._hyper_conn,
self._guest = Guest(conn=self._hyper_conn,
parsexml=self.original_xml)
self._guest.replace = self.replace

View File

@ -25,13 +25,13 @@ import tempfile
import urlgrabber
import Storage
import support
import util
import Installer
from VirtualDisk import VirtualDisk
from User import User
import OSDistro
from virtinst import Storage
from virtinst import support
from virtinst import util
from virtinst import Installer
from virtinst.VirtualDisk import VirtualDisk
from virtinst.User import User
from virtinst import OSDistro
def _is_url(url, is_local):

View File

@ -17,8 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
def _none_or_bool(val):
if val is None:

View File

@ -19,9 +19,9 @@
import re
import util
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import util
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
def get_phy_cpus(conn):

View File

@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from Guest import Guest
from virtinst.Guest import Guest
class FullVirtGuest(Guest):

View File

@ -28,26 +28,26 @@ import urlgrabber.progress as progress
import libvirt
import libxml2
import util
import CapabilitiesParser
import VirtualGraphics
import support
import XMLBuilderDomain
from virtinst import util
from virtinst import CapabilitiesParser
from virtinst import VirtualGraphics
from virtinst import support
from virtinst import XMLBuilderDomain
import virtinst
from XMLBuilderDomain import _xml_property
import DistroInstaller
from VirtualDevice import VirtualDevice
from VirtualDisk import VirtualDisk
from VirtualInputDevice import VirtualInputDevice
from VirtualCharDevice import VirtualCharDevice
from VirtualController import VirtualControllerUSB
from Clock import Clock
from Seclabel import Seclabel
from CPU import CPU
from DomainNumatune import DomainNumatune
from DomainFeatures import DomainFeatures
from virtinst.XMLBuilderDomain import _xml_property
from virtinst import DistroInstaller
from virtinst.VirtualDevice import VirtualDevice
from virtinst.VirtualDisk import VirtualDisk
from virtinst.VirtualInputDevice import VirtualInputDevice
from virtinst.VirtualCharDevice import VirtualCharDevice
from virtinst.VirtualController import VirtualControllerUSB
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
import osdict
from virtinst import osdict
class Guest(XMLBuilderDomain.XMLBuilderDomain):
@ -882,7 +882,7 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
for dev in devs:
xml = util.xml_append(xml, get_dev_xml(dev))
if (dev.address.type == "spapr-vio" and
dev.virtual_device_type == virtinst.VirtualDevice.VIRTUAL_DEV_DISK):
dev.virtual_device_type == VirtualDevice.VIRTUAL_DEV_DISK):
xml = util.xml_append(xml, get_vscsi_ctrl_xml())
return xml

View File

@ -20,10 +20,10 @@
import os
import Installer
import ImageParser
import CapabilitiesParser as Cap
from VirtualDisk import VirtualDisk
from virtinst import Installer
from virtinst import ImageParser
from virtinst import CapabilitiesParser as Cap
from virtinst.VirtualDisk import VirtualDisk
class ImageInstallerException(Exception):

View File

@ -25,8 +25,8 @@ import os
import libxml2
import urlgrabber
import CapabilitiesParser
import util
from virtinst import CapabilitiesParser
from virtinst import util
class ParserException(Exception):

View File

@ -17,8 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import Installer
from VirtualDisk import VirtualDisk
from virtinst import Installer
from virtinst.VirtualDisk import VirtualDisk
class ImportInstaller(Installer.Installer):
"""

View File

@ -26,13 +26,13 @@ import platform
import logging
import copy
import util
from virtinst import util
import virtinst
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
from virtinst import CapabilitiesParser
from VirtualDisk import VirtualDisk
from Boot import Boot
from virtinst.VirtualDisk import VirtualDisk
from virtinst.Boot import Boot
XEN_SCRATCH = "/var/lib/xen"
LIBVIRT_SCRATCH = "/var/lib/libvirt/boot"

View File

@ -24,8 +24,8 @@ import libvirt
import logging
import util
import support
from virtinst import util
from virtinst import support
class Interface(object):

View File

@ -19,8 +19,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import Installer
from VirtualDisk import VirtualDisk
from virtinst import Installer
from virtinst.VirtualDisk import VirtualDisk
class LiveCDInstallerException(Exception):

View File

@ -17,8 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import support
import util
from virtinst import support
from virtinst import util
import libvirt
import logging

View File

@ -28,13 +28,13 @@ import socket
import ConfigParser
import virtinst
import osdict
from virtinst import osdict
from virtinst import util
from ImageFetcher import MountedImageFetcher
from ImageFetcher import FTPImageFetcher
from ImageFetcher import HTTPImageFetcher
from ImageFetcher import DirectImageFetcher
from virtinst.ImageFetcher import MountedImageFetcher
from virtinst.ImageFetcher import FTPImageFetcher
from virtinst.ImageFetcher import HTTPImageFetcher
from virtinst.ImageFetcher import DirectImageFetcher
def safeint(c):
try:

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import Installer
from virtinst import Installer
class PXEInstaller(Installer.Installer):

View File

@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from Guest import Guest
from virtinst.Guest import Guest
class ParaVirtGuest(Guest):
_default_os_type = "xen"

View File

@ -17,8 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
class Seclabel(XMLBuilderDomain.XMLBuilderDomain):
"""

View File

@ -53,9 +53,9 @@ import logging
import libvirt
import urlgrabber
from util import xml_escape as escape
import util
import support
from virtinst.util import xml_escape as escape
from virtinst import util
from virtinst import support
DEFAULT_DEV_TARGET = "/dev"

View File

@ -20,7 +20,7 @@
import os
import platform
import uriutil
from virtinst import uriutil
class User(object):

View File

@ -17,19 +17,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
class VirtualAudio(VirtualDevice.VirtualDevice):
class VirtualAudio(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_AUDIO
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_AUDIO
MODEL_DEFAULT = "default"
MODELS = [ "es1370", "sb16", "pcspk", "ac97", "ich6", MODEL_DEFAULT ]
def __init__(self, model=None, conn=None,
parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn,
VirtualDevice.__init__(self, conn,
parsexml, parsexmlnode, caps)
self._model = None

View File

@ -17,12 +17,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from util import xml_escape
from virtinst.VirtualDevice import VirtualDevice
from virtinst.util import xml_escape
from XMLBuilderDomain import _xml_property
from virtinst.XMLBuilderDomain import _xml_property
class VirtualCharDevice(VirtualDevice.VirtualDevice):
class VirtualCharDevice(VirtualDevice):
"""
Base class for all character devices. Shouldn't be instantiated
directly.
@ -181,7 +181,7 @@ class VirtualCharDevice(VirtualDevice.VirtualDevice):
self._dev_type = dev_type
self._virtual_device_type = self._dev_type
VirtualDevice.VirtualDevice.__init__(self, conn,
VirtualDevice.__init__(self, conn,
parsexml, parsexmlnode, caps)
# Init

View File

@ -17,13 +17,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from XMLBuilderDomain import XMLBuilderDomain, _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import XMLBuilderDomain, _xml_property
import logging
class VirtualController(VirtualDevice.VirtualDevice):
class VirtualController(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_CONTROLLER
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_CONTROLLER
CONTROLLER_TYPE_IDE = "ide"
CONTROLLER_TYPE_FDC = "fdc"
@ -72,7 +72,7 @@ class VirtualController(VirtualDevice.VirtualDevice):
def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None,
model=None):
VirtualDevice.VirtualDevice.__init__(self, conn,
VirtualDevice.__init__(self, conn,
parsexml, parsexmlnode, caps)
self._index = 0

View File

@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from XMLBuilderDomain import XMLBuilderDomain, _xml_property
from virtinst.XMLBuilderDomain import XMLBuilderDomain, _xml_property
import logging
class VirtualDevice(XMLBuilderDomain):

View File

@ -33,10 +33,10 @@ import libvirt
import virtinst
from virtinst import uriutil
import util
import Storage
from VirtualDevice import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst import util
from virtinst import Storage
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
def _vdisk_create(path, size, kind, sparse=True):
force_fixed = "raw"

View File

@ -19,12 +19,12 @@
import os
import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
class VirtualFilesystem(VirtualDevice.VirtualDevice):
class VirtualFilesystem(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_FILESYSTEM
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_FILESYSTEM
_target_props = ["dir", "name", "file", "dev"]
@ -70,7 +70,7 @@ class VirtualFilesystem(VirtualDevice.VirtualDevice):
return "dir"
def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
VirtualDevice.__init__(self, conn, parsexml,
parsexmlnode, caps)
self._type = None

View File

@ -20,10 +20,10 @@
import re
import os
import util
import VirtualDevice
import support
from XMLBuilderDomain import _xml_property
from virtinst import util
from virtinst.VirtualDevice import VirtualDevice
from virtinst import support
from virtinst.XMLBuilderDomain import _xml_property
def _get_mode_prop(channel_type):
xpath = "./channel[@name='%s']/@mode" % channel_type
@ -33,9 +33,9 @@ def _get_mode_prop(channel_type):
s._channels[channel_type] = val
return _xml_property(get_mode, set_mode, xpath=xpath)
class VirtualGraphics(VirtualDevice.VirtualDevice):
class VirtualGraphics(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_GRAPHICS
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_GRAPHICS
TYPE_SDL = "sdl"
TYPE_VNC = "vnc"
@ -68,7 +68,7 @@ class VirtualGraphics(VirtualDevice.VirtualDevice):
"""
Return a list of valid keymap values.
"""
import keytable
from virtinst import keytable
orig_list = keytable.keytable.values()
sort_list = []
@ -94,7 +94,7 @@ class VirtualGraphics(VirtualDevice.VirtualDevice):
parsexmlnode=None, tlsPort=-1, channels=None,
caps=None, passwdValidTo=None):
VirtualDevice.VirtualDevice.__init__(self, conn,
VirtualDevice.__init__(self, conn,
parsexml, parsexmlnode, caps)
self._type = None

View File

@ -17,15 +17,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
import NodeDeviceParser
from virtinst.VirtualDevice import VirtualDevice
from virtinst import NodeDeviceParser
import logging
from XMLBuilderDomain import _xml_property
from virtinst.XMLBuilderDomain import _xml_property
class VirtualHostDevice(VirtualDevice.VirtualDevice):
class VirtualHostDevice(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_HOSTDEV
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_HOSTDEV
def device_from_node(conn, name=None, nodedev=None):
"""
@ -76,7 +76,7 @@ class VirtualHostDevice(VirtualDevice.VirtualDevice):
attached to the guest
@type nodedev: L{virtinst.NodeDeviceParser.NodeDevice}
"""
VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
VirtualDevice.__init__(self, conn, parsexml,
parsexmlnode, caps)
self._mode = None

View File

@ -17,12 +17,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
class VirtualInputDevice(VirtualDevice.VirtualDevice):
class VirtualInputDevice(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_INPUT
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_INPUT
INPUT_TYPE_MOUSE = "mouse"
INPUT_TYPE_TABLET = "tablet"
@ -37,7 +37,7 @@ class VirtualInputDevice(VirtualDevice.VirtualDevice):
INPUT_BUS_DEFAULT]
def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
VirtualDevice.__init__(self, conn, parsexml,
parsexmlnode, caps)
self._type = None

View File

@ -17,19 +17,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
class VirtualMemballoon(VirtualDevice.VirtualDevice):
class VirtualMemballoon(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_MEMBALLOON
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_MEMBALLOON
MODEL_DEFAULT = "virtio"
MODELS = [ "xen", "none", MODEL_DEFAULT ]
def __init__(self, conn=None, model=MODEL_DEFAULT,
parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
VirtualDevice.__init__(self, conn, parsexml,
parsexmlnode, caps)
self._model = None

View File

@ -20,10 +20,10 @@
import logging
import libvirt
import util
import VirtualDevice
import XMLBuilderDomain
from XMLBuilderDomain import _xml_property
from virtinst import util
from virtinst.VirtualDevice import VirtualDevice
from virtinst import XMLBuilderDomain
from virtinst.XMLBuilderDomain import _xml_property
def _compareMAC(p, q):
@ -114,9 +114,9 @@ class VirtualPort(XMLBuilderDomain.XMLBuilderDomain):
# FIXME: This should be implemented, currently we can only parse
return ""
class VirtualNetworkInterface(VirtualDevice.VirtualDevice):
class VirtualNetworkInterface(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_NET
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_NET
TYPE_BRIDGE = "bridge"
TYPE_VIRTUAL = "network"
@ -145,7 +145,7 @@ class VirtualNetworkInterface(VirtualDevice.VirtualDevice):
def __init__(self, macaddr=None, type=TYPE_BRIDGE, bridge=None,
network=None, model=None, conn=None,
parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
VirtualDevice.__init__(self, conn, parsexml,
parsexmlnode, caps)
self._network = None

View File

@ -19,13 +19,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from virtinst.VirtualDevice import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.XMLBuilderDomain import _xml_property
class VirtualRedirDevice(VirtualDevice.VirtualDevice):
class VirtualRedirDevice(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_REDIRDEV
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_REDIRDEV
BUS_DEFAULT = "usb"
_buses = [ "usb" ]
@ -39,7 +39,7 @@ class VirtualRedirDevice(VirtualDevice.VirtualDevice):
@param conn: Connection the device/guest will be installed on
@type conn: libvirt.virConnect
"""
VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
VirtualDevice.__init__(self, conn, parsexml,
parsexmlnode, caps)
self._type = None

View File

@ -19,12 +19,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
class VirtualSmartCardDevice(VirtualDevice.VirtualDevice):
class VirtualSmartCardDevice(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_SMARTCARD
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_SMARTCARD
# Default models list
MODE_DEFAULT = "passthrough"
@ -35,7 +35,7 @@ class VirtualSmartCardDevice(VirtualDevice.VirtualDevice):
def __init__(self, conn, mode=MODE_DEFAULT,
parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn,
VirtualDevice.__init__(self, conn,
parsexml, parsexmlnode, caps)
self._mode = None

View File

@ -17,12 +17,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
class VirtualVideoDevice(VirtualDevice.VirtualDevice):
class VirtualVideoDevice(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_VIDEO
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_VIDEO
# Default models list
MODEL_DEFAULT = "default"
@ -35,7 +35,7 @@ class VirtualVideoDevice(VirtualDevice.VirtualDevice):
return model.capitalize()
def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn,
VirtualDevice.__init__(self, conn,
parsexml, parsexmlnode, caps)
self._model_type = None

View File

@ -17,12 +17,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import VirtualDevice
from XMLBuilderDomain import _xml_property
from virtinst.VirtualDevice import VirtualDevice
from virtinst.XMLBuilderDomain import _xml_property
class VirtualWatchdog(VirtualDevice.VirtualDevice):
class VirtualWatchdog(VirtualDevice):
_virtual_device_type = VirtualDevice.VirtualDevice.VIRTUAL_DEV_WATCHDOG
_virtual_device_type = VirtualDevice.VIRTUAL_DEV_WATCHDOG
MODEL_DEFAULT = "default"
MODELS = [ "i6300esb", "ib700", MODEL_DEFAULT ]
@ -55,7 +55,7 @@ class VirtualWatchdog(VirtualDevice.VirtualDevice):
return action
def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
VirtualDevice.__init__(self, conn, parsexml,
parsexmlnode, caps)
self._model = None

View File

@ -25,9 +25,9 @@ import threading
import libvirt
import libxml2
import CapabilitiesParser
import uriutil
import util
from virtinst import CapabilitiesParser
from virtinst import uriutil
from virtinst import util
_xml_refs_lock = threading.Lock()
_xml_refs = {}

View File

@ -21,38 +21,33 @@ cliutils.setup_i18n()
# Public imports
import Storage
import Interface
from Guest import Guest
from VirtualDevice import VirtualDevice
from VirtualNetworkInterface import VirtualNetworkInterface
from VirtualGraphics import VirtualGraphics
from VirtualAudio import VirtualAudio
from VirtualInputDevice import VirtualInputDevice
from VirtualDisk import VirtualDisk
from VirtualHostDevice import (VirtualHostDevice, VirtualHostDeviceUSB,
VirtualHostDevicePCI)
from VirtualCharDevice import VirtualCharDevice
from VirtualVideoDevice import VirtualVideoDevice
from VirtualController import VirtualController
from VirtualWatchdog import VirtualWatchdog
from VirtualFilesystem import VirtualFilesystem
from VirtualSmartCardDevice import VirtualSmartCardDevice
from VirtualRedirDevice import VirtualRedirDevice
from VirtualMemballoon import VirtualMemballoon
from FullVirtGuest import FullVirtGuest
from ParaVirtGuest import ParaVirtGuest
from DistroInstaller import DistroInstaller
from PXEInstaller import PXEInstaller
from LiveCDInstaller import LiveCDInstaller
from ImportInstaller import ImportInstaller
from ImageInstaller import ImageInstaller
from Installer import ContainerInstaller
from CloneManager import CloneDesign
from User import User
from Clock import Clock
from CPU import CPU, CPUFeature
from Seclabel import Seclabel
from XMLBuilderDomain import XMLBuilderDomain
import util
import support
from virtinst.Guest import Guest
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,
VirtualHostDeviceUSB,
VirtualHostDevicePCI)
from virtinst.VirtualCharDevice import VirtualCharDevice
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.FullVirtGuest import FullVirtGuest
from virtinst.ParaVirtGuest import ParaVirtGuest
from virtinst.DistroInstaller import DistroInstaller
from virtinst.PXEInstaller import PXEInstaller
from virtinst.LiveCDInstaller import LiveCDInstaller
from virtinst.ImportInstaller import ImportInstaller
from virtinst.ImageInstaller import ImageInstaller
from virtinst.Installer import ContainerInstaller
from virtinst.CloneManager import CloneDesign
from virtinst.User import User
from virtinst.Clock import Clock
from virtinst.CPU import CPU, CPUFeature
from virtinst.Seclabel import Seclabel

View File

@ -38,7 +38,7 @@ from virtcli import cliconfig
import virtinst
from virtinst import util
from util import listify
from virtinst.util import listify
from virtinst import Guest
from virtinst import VirtualNetworkInterface
@ -46,7 +46,6 @@ from virtinst import VirtualGraphics
from virtinst import VirtualAudio
from virtinst import VirtualDisk
from virtinst import VirtualCharDevice
from virtinst import VirtualDevice
from virtinst import User
@ -963,7 +962,7 @@ def get_graphics(guest, graphics):
def get_video(guest, video_models=None):
video_models = video_models or []
if guest.get_devices(VirtualDevice.VIRTUAL_DEV_GRAPHICS):
if guest.get_devices(VirtualGraphics.VIRTUAL_DEV_GRAPHICS):
if not video_models:
video_models.append(None)
@ -1693,7 +1692,7 @@ def parse_graphics(guest, optstring, dev=None):
if not keymap:
return None
if keymap.lower() == "local":
return virtinst.VirtualGraphics.KEYMAP_LOCAL
return VirtualGraphics.KEYMAP_LOCAL
if keymap.lower() == "none":
return None

View File

@ -19,8 +19,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
import support
from VirtualDevice import VirtualDevice
from virtinst import support
from virtinst.VirtualDevice import VirtualDevice
HV_ALL = "all"

View File

@ -20,7 +20,7 @@
# MA 02110-1301 USA.
import libvirt
import uriutil
from virtinst import uriutil
# Flags for check_conn_support

View File

@ -35,7 +35,7 @@ import subprocess
import libvirt
import libxml2
import uriutil
from virtinst import uriutil
def listify(l):
if l is None:
@ -664,7 +664,7 @@ def default_keymap():
def is_storage_capable(conn):
"""check if virConnectPtr passed has storage API support"""
import support
from virtinst import support
return support.check_conn_support(conn, support.SUPPORT_CONN_STORAGE)
@ -729,7 +729,8 @@ def lookup_pool_by_path(conn, path):
return None
def check_keytable(kt):
import keytable
from virtinst import keytable
keymap = None
# Try a simple lookup in the keytable
if kt.lower() in keytable.keytable: