mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 17:57:34 +03:00
tui: Enable pylint check for TUI, fix a bunch of reports
There are still a lot of errors reported, so more patches are required to make pylint silent.
This commit is contained in:
parent
7e86f73b7f
commit
303c8c91df
@ -27,7 +27,7 @@ import locale
|
||||
import gettext
|
||||
import traceback
|
||||
import signal
|
||||
from optparse import OptionParser, OptionValueError
|
||||
import optparse
|
||||
|
||||
try:
|
||||
# Make sure we have a default '_' implementation, in case something
|
||||
@ -130,8 +130,8 @@ def drop_stdio():
|
||||
os.dup2(0, 2)
|
||||
|
||||
def parse_commandline():
|
||||
optParser = OptionParser(version=appversion,
|
||||
usage="virt-manager [options]")
|
||||
optParser = optparse.OptionParser(version=appversion,
|
||||
usage="virt-manager [options]")
|
||||
|
||||
optParser.add_option("--profile", dest="profile",
|
||||
help="Generate runtime performance profile stats", metavar="FILE")
|
||||
@ -373,7 +373,8 @@ def main():
|
||||
appname + "-icon.svg")
|
||||
|
||||
if options.show and options.uri == None:
|
||||
raise OptionValueError("can't use --show-* options without --connect")
|
||||
raise optparse.OptionValueError("can't use --show-* options "
|
||||
"without --connect")
|
||||
|
||||
engine = vmmEngine()
|
||||
|
||||
|
@ -23,7 +23,6 @@ import os
|
||||
from createmeter import CreateMeter
|
||||
from domainconfig import DomainConfig
|
||||
from configscreen import ConfigScreen
|
||||
import utils
|
||||
from virtinst import Guest
|
||||
|
||||
VM_DETAILS_PAGE = 1
|
||||
@ -42,13 +41,13 @@ BRIDGE_PAGE = 13
|
||||
VIRT_DETAILS_PAGE = 14
|
||||
CONFIRM_PAGE = 15
|
||||
|
||||
LOCATION="location"
|
||||
KICKSTART="kickstart"
|
||||
KERNELOPTS="kernel.options"
|
||||
OS_TYPE="os.type"
|
||||
OS_VARIANT="os.variant"
|
||||
MEMORY="memory"
|
||||
CPUS="cpus"
|
||||
LOCATION = "location"
|
||||
KICKSTART = "kickstart"
|
||||
KERNELOPTS = "kernel.options"
|
||||
OS_TYPE = "os.type"
|
||||
OS_VARIANT = "os.variant"
|
||||
MEMORY = "memory"
|
||||
CPUS = "cpus"
|
||||
|
||||
class DomainConfigScreen(ConfigScreen):
|
||||
def __init__(self):
|
||||
@ -314,7 +313,7 @@ class DomainConfigScreen(ConfigScreen):
|
||||
("Network Boot (PXE)",
|
||||
DomainConfig.PXE_INSTALL,
|
||||
self.__config.is_install_type(DomainConfig.PXE_INSTALL))))
|
||||
grid = snack.Grid(2,3)
|
||||
grid = snack.Grid(2, 3)
|
||||
grid.setField(snack.Label("Name:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(self.__guest_name, 1, 0, anchorLeft = 1)
|
||||
grid.setField(snack.Label("Choose how you would like to install the operating system"), 1, 1,
|
||||
@ -330,7 +329,7 @@ class DomainConfigScreen(ConfigScreen):
|
||||
("Use ISO image",
|
||||
DomainConfig.INSTALL_SOURCE_ISO,
|
||||
self.__config.get_use_cdrom_source() is False)))
|
||||
grid = snack.Grid(1,1)
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__install_source, 0, 0, anchorLeft = 1)
|
||||
return [snack.Label("Locate your install media"),
|
||||
grid]
|
||||
@ -347,6 +346,7 @@ class DomainConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_select_iso_page(self, screen):
|
||||
ignore = screen
|
||||
self.__iso_path = snack.Entry(50, self.__config.get_iso_path())
|
||||
grid = snack.Grid(1, 2)
|
||||
grid.setField(snack.Label("Enter ISO path:"), 0, 0, anchorLeft = 1)
|
||||
@ -355,10 +355,11 @@ class DomainConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_network_install_page(self, screen):
|
||||
ignore = screen
|
||||
self.__install_url = snack.Entry(50, self.__config.get_install_url())
|
||||
self.__kickstart_url = snack.Entry(50, self.__config.get_kickstart_url())
|
||||
self.__kernel_options = snack.Entry(50, self.__config.get_kernel_options())
|
||||
grid = snack.Grid(2,3)
|
||||
grid = snack.Grid(2, 3)
|
||||
grid.setField(snack.Label("URL:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(self.__install_url, 1, 0, anchorLeft = 1)
|
||||
grid.setField(snack.Label("Kickstart URL:"), 0, 1, anchorRight = 1)
|
||||
@ -370,8 +371,8 @@ class DomainConfigScreen(ConfigScreen):
|
||||
|
||||
def get_os_type_page(self, screen):
|
||||
types = []
|
||||
for type in Guest.list_os_types():
|
||||
types.append([Guest.get_os_type_label(type), type, self.__config.is_os_type(type)])
|
||||
for typ in Guest.list_os_types():
|
||||
types.append([Guest.get_os_type_label(typ), typ, self.__config.is_os_type(typ)])
|
||||
self.__os_types = snack.RadioBar(screen, types)
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__os_types, 0, 0, anchorLeft = 1)
|
||||
@ -380,9 +381,9 @@ class DomainConfigScreen(ConfigScreen):
|
||||
|
||||
def get_os_variant_page(self, screen):
|
||||
variants = []
|
||||
type = self.__config.get_os_type()
|
||||
for variant in Guest.list_os_variants(type):
|
||||
variants.append([Guest.get_os_variant_label(type, variant), variant, self.__config.is_os_variant(variant)])
|
||||
typ = self.__config.get_os_type()
|
||||
for variant in Guest.list_os_variants(typ):
|
||||
variants.append([Guest.get_os_variant_label(typ, variant), variant, self.__config.is_os_variant(variant)])
|
||||
self.__os_variants = snack.RadioBar(screen, variants)
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__os_variants, 0, 0, anchorLeft = 1)
|
||||
@ -390,9 +391,10 @@ class DomainConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_ram_and_cpu_page(self, screen):
|
||||
ignore = screen
|
||||
self.__memory = snack.Entry(10, str(self.__config.get_memory()))
|
||||
self.__cpus = snack.Entry(10, str(self.__config.get_cpus()))
|
||||
grid = snack.Grid(2,2)
|
||||
grid = snack.Grid(2, 2)
|
||||
grid.setField(snack.Label("Memory (RAM):"), 0, 0, anchorRight = 1)
|
||||
grid.setField(self.__memory, 1, 0, anchorLeft = 1)
|
||||
grid.setField(snack.Label("CPUs:"), 0, 1, anchorRight = 1)
|
||||
@ -408,13 +410,14 @@ class DomainConfigScreen(ConfigScreen):
|
||||
(["Select managed or other existing storage",
|
||||
DomainConfig.EXISTING_STORAGE,
|
||||
self.__config.get_use_local_storage() is False])))
|
||||
grid = snack.Grid(1,2)
|
||||
grid = snack.Grid(1, 2)
|
||||
grid.setField(self.__enable_storage, 0, 0, anchorLeft = 1)
|
||||
grid.setField(self.__storage_type, 0, 1, anchorLeft = 1)
|
||||
return [snack.Label("Configure storage"),
|
||||
grid]
|
||||
|
||||
def get_local_storage_page(self, screen):
|
||||
ignore = screen
|
||||
self.__storage_size = snack.Entry(6, str(self.__config.get_storage_size()))
|
||||
self.__allocate_storage = snack.Checkbox("Allocate entire disk now", self.__config.get_allocate_storage())
|
||||
grid = snack.Grid(2, 2)
|
||||
@ -441,20 +444,20 @@ class DomainConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_select_volume_page(self, screen):
|
||||
volumes = []
|
||||
for volume in self.get_libvirt().list_storage_volumes(self.__config.get_storage_pool()):
|
||||
volumes.append([volume, volume, volume == self.__config.get_storage_volume()])
|
||||
if len(volumes) > 0:
|
||||
self.__storage_volume = snack.RadioBar(screen, (volumes))
|
||||
grid = snack.Grid(2, 1)
|
||||
grid.setField(snack.Label("Storage volumes:"), 0, 0, anchorTop = 1)
|
||||
grid.setField(self.__storage_volume, 1, 0)
|
||||
self.__has_volumes = True
|
||||
else:
|
||||
grid = snack.Label("This storage pool has no defined volumes.")
|
||||
self.__has_volumes = False
|
||||
return [snack.Label("Configure Managed Storage: Select A Volume"),
|
||||
grid]
|
||||
volumes = []
|
||||
for volume in self.get_libvirt().list_storage_volumes(self.__config.get_storage_pool()):
|
||||
volumes.append([volume, volume, volume == self.__config.get_storage_volume()])
|
||||
if len(volumes) > 0:
|
||||
self.__storage_volume = snack.RadioBar(screen, (volumes))
|
||||
grid = snack.Grid(2, 1)
|
||||
grid.setField(snack.Label("Storage volumes:"), 0, 0, anchorTop = 1)
|
||||
grid.setField(self.__storage_volume, 1, 0)
|
||||
self.__has_volumes = True
|
||||
else:
|
||||
grid = snack.Label("This storage pool has no defined volumes.")
|
||||
self.__has_volumes = False
|
||||
return [snack.Label("Configure Managed Storage: Select A Volume"),
|
||||
grid]
|
||||
|
||||
def get_bridge_page(self, screen):
|
||||
bridges = []
|
||||
@ -471,8 +474,8 @@ class DomainConfigScreen(ConfigScreen):
|
||||
|
||||
def get_virt_details_page(self, screen):
|
||||
virt_types = []
|
||||
for type in self.get_libvirt().list_virt_types():
|
||||
virt_types.append([type, type, self.__config.is_virt_type(type)])
|
||||
for typ in self.get_libvirt().list_virt_types():
|
||||
virt_types.append([typ, typ, self.__config.is_virt_type(typ)])
|
||||
self.__virt_types = snack.RadioBar(screen, (virt_types))
|
||||
archs = []
|
||||
for arch in self.get_libvirt().list_architectures():
|
||||
@ -487,6 +490,7 @@ class DomainConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(2, 6)
|
||||
grid.setField(snack.Label("OS:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(snack.Label(Guest.get_os_variant_label(self.__config.get_os_type(),
|
||||
|
@ -112,6 +112,8 @@ class AddHostConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
|
||||
grid = snack.Grid(2, 4)
|
||||
grid.setField(snack.Label("Hypervisor:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(snack.Label(HYPERVISORS[self.__hypervisor.getSelection()]), 1, 0, anchorLeft = 1)
|
||||
|
@ -17,7 +17,6 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
import traceback
|
||||
import utils
|
||||
|
||||
from configscreen import ConfigScreen
|
||||
@ -44,8 +43,6 @@ class AddStoragePoolConfigScreen(ConfigScreen):
|
||||
def page_has_back(self, page):
|
||||
return page > POOL_NAME_PAGE
|
||||
|
||||
return page > POOL_NAME_PAGE
|
||||
|
||||
def page_has_finish(self, page):
|
||||
return page is CONFIRM_PAGE
|
||||
|
||||
@ -133,8 +130,8 @@ class AddStoragePoolConfigScreen(ConfigScreen):
|
||||
rows += 1
|
||||
if self.__config.needs_format():
|
||||
formats = []
|
||||
for format in self.__config.get_formats():
|
||||
formats.append([format, format, format is self.__config.get_format()])
|
||||
for fmt in self.__config.get_formats():
|
||||
formats.append([fmt, fmt, fmt is self.__config.get_format()])
|
||||
self.__formats = snack.RadioBar(screen, formats)
|
||||
rows += 1
|
||||
if self.__config.needs_hostname():
|
||||
@ -174,6 +171,7 @@ class AddStoragePoolConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(2, 2)
|
||||
grid.setField(snack.Label("Name:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(snack.Label(self.__config.get_name()), 1, 0, anchorLeft = 1)
|
||||
|
@ -17,7 +17,6 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
import traceback
|
||||
|
||||
from createmeter import CreateMeter
|
||||
from configscreen import StorageListConfigScreen
|
||||
@ -67,7 +66,7 @@ class AddVolumeConfigScreen(StorageListConfigScreen):
|
||||
def get_back_page(self, page):
|
||||
if page is MAX_CAPACITY_PAGE:
|
||||
if self.__config.needs_format():
|
||||
return VOLUME_FORMAT_PATH
|
||||
return VOLUME_FORMAT_PAGE
|
||||
else:
|
||||
return VOLUME_NAME_PAGE
|
||||
return StorageListConfigScreen.get_back_page(self, page)
|
||||
@ -128,6 +127,7 @@ class AddVolumeConfigScreen(StorageListConfigScreen):
|
||||
self.set_finished()
|
||||
|
||||
def get_volume_name_page(self, screen):
|
||||
ignore = screen
|
||||
self.__name = snack.Entry(50, self.__config.get_name())
|
||||
grid = snack.Grid(2, 1)
|
||||
grid.setField(snack.Label("Name:"), 0, 0, anchorRight = 1)
|
||||
@ -137,15 +137,17 @@ class AddVolumeConfigScreen(StorageListConfigScreen):
|
||||
snack.Label("Name of the volume to create. File extension may be appended.")]
|
||||
|
||||
def get_volume_format_page(self, screen):
|
||||
ignore = screen
|
||||
self.__formats = snack.Listbox(0)
|
||||
for format in self.__config.get_formats_for_pool():
|
||||
self.__formats.append(format, format)
|
||||
for fmt in self.__config.get_formats_for_pool():
|
||||
self.__formats.append(fmt, fmt)
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__formats, 0, 0)
|
||||
return [snack.Label("Select The Volume Format"),
|
||||
grid]
|
||||
|
||||
def get_max_capacity_page(self, screen):
|
||||
ignore = screen
|
||||
self.__capacity = snack.Entry(6, str(self.__config.get_max_capacity()))
|
||||
self.__allocation = snack.Entry(6, str(self.__config.get_allocation()))
|
||||
grid = snack.Grid(2, 2)
|
||||
@ -159,6 +161,7 @@ class AddVolumeConfigScreen(StorageListConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(2, 5)
|
||||
grid.setField(snack.Label("Volume Name:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(snack.Label("%s (%s)" % (self.__config.get_name(), self.__config.get_pool().name())), 1, 0, anchorLeft = 1)
|
||||
|
@ -19,7 +19,6 @@
|
||||
import snack
|
||||
|
||||
import logging
|
||||
import libvirtworker
|
||||
from configscreen import HostListConfigScreen
|
||||
|
||||
CONNECTION_LIST_PAGE = 1
|
||||
@ -53,6 +52,7 @@ class ChangeHostConfigScreen(HostListConfigScreen):
|
||||
return page is CONNECTED_PAGE
|
||||
|
||||
def get_connected_page(self, screen):
|
||||
ignore = screen
|
||||
return [snack.Label("Connected to %s" % self.get_selected_connection())]
|
||||
|
||||
def ChangeHost():
|
||||
|
@ -53,12 +53,16 @@ class ConfigScreen:
|
||||
self.__finished = True
|
||||
|
||||
def get_elements_for_page(self, screen, page):
|
||||
ignore = screen
|
||||
ignore = page
|
||||
return []
|
||||
|
||||
def page_has_next(self, page):
|
||||
ignore = page
|
||||
return False
|
||||
|
||||
def page_has_finish(self, page):
|
||||
ignore = page
|
||||
return False
|
||||
|
||||
def get_back_page(self, page):
|
||||
@ -75,16 +79,19 @@ class ConfigScreen:
|
||||
self.__current_page = self.get_next_page(self.__current_page)
|
||||
|
||||
def validate_input(self, page, errors):
|
||||
ignore = page
|
||||
ignore = errors
|
||||
return True
|
||||
|
||||
def process_input(self, page):
|
||||
ignore = page
|
||||
return
|
||||
|
||||
def get_page_list(self):
|
||||
return []
|
||||
|
||||
def get_current_page(self):
|
||||
0
|
||||
return 0
|
||||
|
||||
def start(self):
|
||||
active = True
|
||||
@ -160,6 +167,7 @@ class DomainListConfigScreen(ConfigScreen):
|
||||
ConfigScreen.__init__(self, title)
|
||||
|
||||
def get_domain_list_page(self, screen, defined=True, created=True):
|
||||
ignore = screen
|
||||
domuuids = self.get_libvirt().list_domains(defined, created)
|
||||
self.__has_domains = bool(domuuids)
|
||||
result = None
|
||||
@ -192,6 +200,7 @@ class NetworkListConfigScreen(ConfigScreen):
|
||||
ConfigScreen.__init__(self, title)
|
||||
|
||||
def get_network_list_page(self, screen, defined=True, started=True):
|
||||
ignore = screen
|
||||
uuids = self.get_libvirt().list_networks(defined, started)
|
||||
result = None
|
||||
|
||||
@ -224,6 +233,7 @@ class StorageListConfigScreen(ConfigScreen):
|
||||
ConfigScreen.__init__(self, title)
|
||||
|
||||
def get_storage_pool_list_page(self, screen, defined=True, created=True):
|
||||
ignore = screen
|
||||
pools = self.get_libvirt().list_storage_pools(defined=defined, created=created)
|
||||
if len(pools) > 0:
|
||||
self.__has_pools = True
|
||||
@ -247,6 +257,7 @@ class StorageListConfigScreen(ConfigScreen):
|
||||
|
||||
def get_storage_volume_list_page(self, screen):
|
||||
'''Requires that self.__pools_list have a selected element.'''
|
||||
ignore = screen
|
||||
pool = self.get_libvirt().get_storage_pool(self.get_selected_pool())
|
||||
if len(pool.listVolumes()) > 0:
|
||||
self.__has_volumes = True
|
||||
@ -276,6 +287,7 @@ class HostListConfigScreen(ConfigScreen):
|
||||
ConfigScreen.__init__(self, title)
|
||||
|
||||
def get_connection_list_page(self, screen):
|
||||
ignore = screen
|
||||
connections = self.get_virt_manager_config().get_connection_list()
|
||||
result = None
|
||||
|
||||
|
@ -74,6 +74,8 @@ class CreateUserConfigScreen(ConfigScreen):
|
||||
return (page is CONFIRM_PAGE)
|
||||
|
||||
def get_details_page(self, screen):
|
||||
ignore = screen
|
||||
|
||||
if self.__username is None:
|
||||
self.__username = snack.Entry(50, "")
|
||||
self.__password = snack.Entry(50, "", password = 1)
|
||||
@ -92,6 +94,7 @@ class CreateUserConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(1, 2)
|
||||
grid.setField(snack.Label("Username: %s" % self.__username.value()), 0, 0)
|
||||
admin_label = "is not"
|
||||
|
@ -18,11 +18,9 @@
|
||||
|
||||
import snack
|
||||
from IPy import IP
|
||||
import traceback
|
||||
import logging
|
||||
import re
|
||||
|
||||
import utils
|
||||
from configscreen import ConfigScreen
|
||||
from networkconfig import NetworkConfig
|
||||
|
||||
@ -138,6 +136,7 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
return False
|
||||
|
||||
def get_network_name_page(self, screen):
|
||||
ignore = screen
|
||||
self.__name = snack.Entry(50, self.__config.get_name())
|
||||
grid = snack.Grid(2, 1)
|
||||
grid.setField(snack.Label("Network Name:"), 0, 0)
|
||||
@ -146,6 +145,7 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_ipv4_address_page(self, screen):
|
||||
ignore = screen
|
||||
self.__ipv4_address = snack.Entry(18, self.__config.get_ipv4_address())
|
||||
grid = snack.Grid(2, 1)
|
||||
grid.setField(snack.Label("Network:"), 0, 0, anchorRight = 1)
|
||||
@ -157,6 +157,7 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
snack.Label("e.g., 10.0.0.0/8, 172.168.0.0/12, 192.168.0.0/16")]
|
||||
|
||||
def get_network_details_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(2, 6)
|
||||
grid.setField(snack.Label("Network:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(snack.Label(self.__config.get_ipv4_address()), 1, 0, anchorLeft = 1)
|
||||
@ -174,6 +175,7 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_public_network_alert_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(1, 2)
|
||||
grid.setField(snack.Label("The network should normally use a private IPv4 address."), 0, 0, anchorLeft = 1)
|
||||
grid.setField(snack.Label("Use this non-private address anyway?"), 0, 1, anchorLeft = 1)
|
||||
@ -181,9 +183,10 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_dhcp_range_page(self, screen):
|
||||
ignore = screen
|
||||
self.__start_address = snack.Entry(15, self.__config.get_ipv4_start_address())
|
||||
self.__end_address = snack.Entry(15, self.__config.get_ipv4_end_address())
|
||||
grid = snack.Grid(2,2)
|
||||
grid = snack.Grid(2, 2)
|
||||
grid.setField(snack.Label("Start:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(self.__start_address, 1, 0, anchorLeft = 1)
|
||||
grid.setField(snack.Label("End:"), 0, 1, anchorRight = 1)
|
||||
@ -195,6 +198,7 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
snack.Label("their default values.")]
|
||||
|
||||
def get_network_type_page(self, screen):
|
||||
ignore = screen
|
||||
self.__isolated_network = snack.Checkbox("Isolated virtual network",
|
||||
self.__config.is_isolated_network())
|
||||
grid = snack.Grid(1, 3)
|
||||
@ -205,6 +209,7 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_select_physical_network_page(self, screen):
|
||||
ignore = screen
|
||||
devices = []
|
||||
devices.append(["NAT to any physical device", "", self.__config.get_physical_device() == ""])
|
||||
for device in self.get_hal().list_network_devices():
|
||||
@ -217,6 +222,7 @@ class DefineNetworkConfigScreen(ConfigScreen):
|
||||
grid]
|
||||
|
||||
def get_summary_page(self, screen):
|
||||
ignore = screen
|
||||
grid1 = snack.Grid(2, 1)
|
||||
grid1.setField(snack.Label("Network name:"), 0, 0, anchorRight = 1)
|
||||
grid1.setField(snack.Label(self.__config.get_name()), 1, 0, anchorLeft = 1)
|
||||
|
@ -48,6 +48,7 @@ class DomainConfig:
|
||||
self.__cpus = 1
|
||||
self.__enable_storage = True
|
||||
self.__use_local_storage = True
|
||||
self.__existing_storage = False
|
||||
self.__storage_size = 8.0
|
||||
self.__allocate_storage = True
|
||||
self.__storage_pool = ""
|
||||
@ -63,8 +64,8 @@ class DomainConfig:
|
||||
def get_guest_name(self):
|
||||
return self.__guest_name
|
||||
|
||||
def set_install_type(self, type):
|
||||
self.__install_type = type
|
||||
def set_install_type(self, typ):
|
||||
self.__install_type = typ
|
||||
|
||||
def get_install_type(self):
|
||||
return self.__install_type
|
||||
@ -72,8 +73,8 @@ class DomainConfig:
|
||||
def get_install_type_text(self):
|
||||
return DomainConfig.INSTALL_TYPE_TEXT[self.get_install_type()]
|
||||
|
||||
def is_install_type(self, type):
|
||||
return self.__install_type == type
|
||||
def is_install_type(self, typ):
|
||||
return self.__install_type == typ
|
||||
|
||||
def set_install_location(self, location):
|
||||
self.__install_location = location
|
||||
@ -123,15 +124,15 @@ class DomainConfig:
|
||||
def get_kernel_options(self):
|
||||
return self.__kernel_options
|
||||
|
||||
def set_os_type(self, type):
|
||||
self.__os_type = type
|
||||
self.__os_variant = Guest.list_os_variants(type)[0]
|
||||
def set_os_type(self, typ):
|
||||
self.__os_type = typ
|
||||
self.__os_variant = Guest.list_os_variants(typ)[0]
|
||||
|
||||
def get_os_type(self):
|
||||
return self.__os_type
|
||||
|
||||
def is_os_type(self, type):
|
||||
return self.__os_type == type
|
||||
def is_os_type(self, typ):
|
||||
return self.__os_type == typ
|
||||
|
||||
def set_os_variant(self, variant):
|
||||
self.__os_variant = variant
|
||||
@ -205,14 +206,14 @@ class DomainConfig:
|
||||
def get_mac_address(self):
|
||||
return self.__mac_address
|
||||
|
||||
def set_virt_type(self, type):
|
||||
self.__virt_type = type
|
||||
def set_virt_type(self, typ):
|
||||
self.__virt_type = typ
|
||||
|
||||
def get_virt_type(self):
|
||||
return self.__virt_type
|
||||
|
||||
def is_virt_type(self, type):
|
||||
return self.__virt_type == type
|
||||
def is_virt_type(self, typ):
|
||||
return self.__virt_type == typ
|
||||
|
||||
def set_architecture(self, architecture):
|
||||
self.__architecture = architecture
|
||||
|
@ -17,7 +17,6 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import dbus
|
||||
import virtinst
|
||||
|
||||
class HALWorker:
|
||||
'''Provides utilities for working with HAL to get hardware information.'''
|
||||
|
@ -16,13 +16,11 @@
|
||||
# MA 02110-1301, USA. A copy of the GNU General Public License is
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
|
||||
from configscreen import ConfigScreen
|
||||
|
||||
class HostConnectConfigScreen(ConfigScreen):
|
||||
def __init__(self):
|
||||
ConfigScreen.__init__(self)
|
||||
ConfigScreen.__init__(self, "Host Connect")
|
||||
|
||||
def HostConnect():
|
||||
screen = HostConnectConfigScreen()
|
||||
|
@ -16,8 +16,6 @@
|
||||
# MA 02110-1301, USA. A copy of the GNU General Public License is
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
|
||||
from menuscreen import MenuScreen
|
||||
from changehost import ChangeHost
|
||||
from addhost import AddHost
|
||||
|
@ -17,10 +17,8 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import os
|
||||
import utils
|
||||
import logging
|
||||
|
||||
import dbus
|
||||
import virtinst
|
||||
import libvirt
|
||||
|
||||
@ -28,8 +26,8 @@ from virtManager.connection import vmmConnection
|
||||
|
||||
from domainconfig import DomainConfig
|
||||
|
||||
DEFAULT_POOL_TARGET_PATH="/var/lib/libvirt/images"
|
||||
DEFAULT_URL="qemu:///system"
|
||||
DEFAULT_POOL_TARGET_PATH = "/var/lib/libvirt/images"
|
||||
DEFAULT_URL = "qemu:///system"
|
||||
|
||||
default_url = DEFAULT_URL
|
||||
|
||||
@ -52,8 +50,8 @@ class VirtManagerConfig:
|
||||
def get_connection_list(self):
|
||||
result = []
|
||||
if os.path.exists(self.__filename):
|
||||
input = file(self.__filename, "r")
|
||||
for entry in input: result.append(entry[0:-1])
|
||||
inp = file(self.__filename, "r")
|
||||
for entry in inp: result.append(entry[0:-1])
|
||||
return result
|
||||
|
||||
def add_connection(self, connection):
|
||||
@ -72,7 +70,7 @@ class VirtManagerConfig:
|
||||
output = file(self.__filename, "w")
|
||||
for entry in connections:
|
||||
print >> output, entry
|
||||
output.close
|
||||
output.close()
|
||||
|
||||
class LibvirtWorker:
|
||||
'''Provides utilities for interfacing with libvirt.'''
|
||||
@ -313,7 +311,7 @@ class LibvirtWorker:
|
||||
|
||||
def get_storage_volume(self, poolname, volumename):
|
||||
'''Returns a reference to the specified storage volume.'''
|
||||
pool =self.get_storage_pool(poolname)
|
||||
pool = self.get_storage_pool(poolname)
|
||||
volume = pool.storageVolLookupByName(volumename)
|
||||
return volume
|
||||
|
||||
@ -367,8 +365,8 @@ class LibvirtWorker:
|
||||
def list_virt_types(self):
|
||||
virt_types = self.get_virt_types()
|
||||
result = []
|
||||
for type in virt_types:
|
||||
result.append(type[0])
|
||||
for typ in virt_types:
|
||||
result.append(typ[0])
|
||||
return result
|
||||
|
||||
def get_default_architecture(self):
|
||||
@ -377,8 +375,8 @@ class LibvirtWorker:
|
||||
|
||||
def get_hypervisor(self, virt_type):
|
||||
virt_types = self.get_virt_types()
|
||||
for type in virt_types:
|
||||
if type[0] is virt_type: return type[1]
|
||||
for typ in virt_types:
|
||||
if typ[0] is virt_type: return typ[1]
|
||||
return None
|
||||
|
||||
def get_default_virt_type(self):
|
||||
@ -387,14 +385,15 @@ class LibvirtWorker:
|
||||
|
||||
def get_os_type(self, virt_type):
|
||||
virt_types = self.get_virt_types()
|
||||
for type in virt_types:
|
||||
if type[0] is virt_type: return type[2]
|
||||
for typ in virt_types:
|
||||
if typ[0] is virt_type: return typ[2]
|
||||
return None
|
||||
|
||||
def list_architectures(self):
|
||||
result = []
|
||||
for guest in self.__capabilities.guests:
|
||||
for domain in guest.domains:
|
||||
ignore = domain
|
||||
label = guest.arch
|
||||
for row in result:
|
||||
if row == label:
|
||||
@ -484,8 +483,8 @@ class LibvirtWorker:
|
||||
path = volume.path()
|
||||
|
||||
if path is not None:
|
||||
storage= virtinst.VirtualDisk(conn = self.__conn,
|
||||
path = path,
|
||||
size = config.get_storage_size())
|
||||
storage = virtinst.VirtualDisk(conn = self.__conn,
|
||||
path = path,
|
||||
size = config.get_storage_size())
|
||||
self.__guest.disks.append(storage)
|
||||
self.__guest.conn = self.__conn
|
||||
|
@ -19,7 +19,6 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
from libvirtworker import LibvirtWorker
|
||||
from configscreen import DomainListConfigScreen
|
||||
|
||||
class ListDomainsConfigScreen(DomainListConfigScreen):
|
||||
@ -49,6 +48,7 @@ class ListDomainsConfigScreen(DomainListConfigScreen):
|
||||
return self.get_detail_page_elements(screen)
|
||||
|
||||
def get_detail_page_elements(self, screen):
|
||||
ignore = screen
|
||||
domain = self.get_selected_domain()
|
||||
fields = []
|
||||
|
||||
|
@ -37,6 +37,7 @@ class ListNetworksConfigScreen(NetworkListConfigScreen):
|
||||
elif page is DETAILS_PAGE: return self.get_network_details_page(screen)
|
||||
|
||||
def get_network_details_page(self, screen):
|
||||
ignore = screen
|
||||
network = self.get_selected_network()
|
||||
fields = []
|
||||
|
||||
|
@ -34,7 +34,7 @@ class ListStoragePoolsConfigScreen(StorageListConfigScreen):
|
||||
|
||||
def page_has_next(self, page):
|
||||
if page is LIST_PAGE and self.has_selectable_pools():
|
||||
return True
|
||||
return True
|
||||
return False
|
||||
|
||||
def page_has_back(self, page):
|
||||
@ -42,11 +42,12 @@ class ListStoragePoolsConfigScreen(StorageListConfigScreen):
|
||||
return False
|
||||
|
||||
def get_pool_details_page(self, screen):
|
||||
ignore = screen
|
||||
pool = self.get_libvirt().get_storage_pool(self.get_selected_pool())
|
||||
volumes = snack.Listbox(0);
|
||||
volumes = snack.Listbox(0)
|
||||
for name in pool.listVolumes():
|
||||
volume = pool.storageVolLookupByName(name)
|
||||
volumes.append("%s (%s)" % (name, util.size_as_mb_or_gb(volume.info()[1])), name)
|
||||
volumes.append("%s (%s)" % (name, utils.size_as_mb_or_gb(volume.info()[1])), name)
|
||||
grid = snack.Grid(2, 3)
|
||||
grid.setField(snack.Label("Name:"), 0, 0, anchorRight = 1)
|
||||
grid.setField(snack.Label(pool.name()), 1, 0, anchorLeft = 1)
|
||||
|
@ -16,18 +16,12 @@
|
||||
# MA 02110-1301, USA. A copy of the GNU General Public License is
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
import traceback
|
||||
|
||||
from menuscreen import MenuScreen
|
||||
from nodemenu import NodeMenu
|
||||
from netmenu import NetworkMenu
|
||||
from storagemenu import StoragePoolMenu
|
||||
from hostmenu import HostMenu
|
||||
|
||||
import utils
|
||||
import logging
|
||||
|
||||
NODE_MENU = 1
|
||||
NETWORK_MENU = 2
|
||||
STORAGE_MENU = 3
|
||||
|
@ -19,7 +19,6 @@
|
||||
import snack
|
||||
import traceback
|
||||
|
||||
import utils
|
||||
import logging
|
||||
|
||||
EXIT_MENU = 99
|
||||
@ -28,6 +27,12 @@ class MenuScreen:
|
||||
def __init__(self, title):
|
||||
self.__title = title
|
||||
|
||||
def get_menu_items(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
def handle_selection(self, item):
|
||||
raise NotImplementedError()
|
||||
|
||||
def start(self):
|
||||
finished = False
|
||||
while finished == False:
|
||||
@ -38,7 +43,7 @@ class MenuScreen:
|
||||
menu.append("Exit Menu", EXIT_MENU)
|
||||
gridform = snack.GridForm(screen, self.__title, 1, 4)
|
||||
gridform.add(menu, 0, 0)
|
||||
result = gridform.run();
|
||||
result = gridform.run()
|
||||
screen.popWindow()
|
||||
screen.finish()
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
from libvirtworker import LibvirtWorker
|
||||
from configscreen import DomainListConfigScreen
|
||||
|
||||
LIST_DOMAINS = 1
|
||||
@ -64,6 +63,7 @@ class MigrateDomainConfigScreen(DomainListConfigScreen):
|
||||
self.set_finished()
|
||||
|
||||
def get_target_page(self, screen):
|
||||
ignore = screen
|
||||
self.__targets = snack.Listbox(0)
|
||||
for connection in self.get_virt_manager_config().get_connection_list():
|
||||
self.__targets.append(connection, connection)
|
||||
@ -71,6 +71,7 @@ class MigrateDomainConfigScreen(DomainListConfigScreen):
|
||||
self.__targets]
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
self.__confirm = snack.Checkbox("Confirm migrating this virtual machine.")
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__confirm, 0, 0)
|
||||
|
@ -16,9 +16,6 @@
|
||||
# MA 02110-1301, USA. A copy of the GNU General Public License is
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
import traceback
|
||||
|
||||
from menuscreen import MenuScreen
|
||||
from definenet import DefineNetwork
|
||||
from startnetwork import StartNetwork
|
||||
@ -26,9 +23,6 @@ from stopnetwork import StopNetwork
|
||||
from undefinenetwork import UndefineNetwork
|
||||
from listnetworks import ListNetworks
|
||||
|
||||
import utils
|
||||
import logging
|
||||
|
||||
DEFINE_NETWORK = 1
|
||||
START_NETWORK = 2
|
||||
STOP_NETWORK = 3
|
||||
|
@ -17,7 +17,6 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
from IPy import IP
|
||||
import logging
|
||||
|
||||
class NetworkConfig:
|
||||
def __init__(self):
|
||||
|
@ -16,11 +16,7 @@
|
||||
# MA 02110-1301, USA. A copy of the GNU General Public License is
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
import traceback
|
||||
|
||||
from menuscreen import MenuScreen
|
||||
from configscreen import ConfigScreen
|
||||
from adddomain import AddDomain
|
||||
from startdomain import StartDomain
|
||||
from stopdomain import StopDomain
|
||||
@ -30,9 +26,6 @@ from listdomains import ListDomains
|
||||
from migratedomain import MigrateDomain
|
||||
from createuser import CreateUser
|
||||
|
||||
import utils
|
||||
import logging
|
||||
|
||||
ADD_DOMAIN = 1
|
||||
START_DOMAIN = 2
|
||||
STOP_DOMAIN = 3
|
||||
@ -57,14 +50,22 @@ class NodeMenuScreen(MenuScreen):
|
||||
("Create A User", CREATE_USER))
|
||||
|
||||
def handle_selection(self, item):
|
||||
if item is ADD_DOMAIN: AddDomain()
|
||||
elif item is START_DOMAIN: StartDomain()
|
||||
elif item is STOP_DOMAIN: StopDomain()
|
||||
elif item is PAUSE_DOMAIN: PauseDomain()
|
||||
elif item is REMOVE_DOMAIN: RemoveDomain()
|
||||
elif item is LIST_DOMAINS: ListDomains()
|
||||
elif item is MIGRATE_DOMAIN: MigrateDomain()
|
||||
elif item is CREATE_USER: CreateUser()
|
||||
if item is ADD_DOMAIN:
|
||||
AddDomain()
|
||||
elif item is START_DOMAIN:
|
||||
StartDomain()
|
||||
elif item is STOP_DOMAIN:
|
||||
StopDomain()
|
||||
elif item is PAUSE_DOMAIN:
|
||||
PauseDomain()
|
||||
elif item is REMOVE_DOMAIN:
|
||||
RemoveDomain()
|
||||
elif item is LIST_DOMAINS:
|
||||
ListDomains()
|
||||
elif item is MIGRATE_DOMAIN:
|
||||
MigrateDomain()
|
||||
elif item is CREATE_USER:
|
||||
CreateUser()
|
||||
|
||||
def NodeMenu():
|
||||
screen = NodeMenuScreen()
|
||||
|
@ -60,6 +60,8 @@ class PauseDomainConfigScreen(DomainListConfigScreen):
|
||||
return False
|
||||
|
||||
def get_stop_page(self, screen):
|
||||
ignore = screen
|
||||
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(snack.Label("%s was successfully paused." % self.get_selected_domain().get_name()), 0, 0)
|
||||
return [grid]
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
from virtinst import Storage
|
||||
|
||||
ROOT_TARGET_PATH="/var/lib/libvirt/images/%s"
|
||||
ROOT_TARGET_PATH = "/var/lib/libvirt/images/%s"
|
||||
|
||||
class PoolConfig:
|
||||
def __init__(self, libvirt):
|
||||
@ -120,8 +120,8 @@ class PoolConfig:
|
||||
def get_formats(self):
|
||||
return self.__pool.formats
|
||||
|
||||
def set_format(self, format):
|
||||
self.__format = format
|
||||
def set_format(self, fmt):
|
||||
self.__format = fmt
|
||||
|
||||
def get_format(self):
|
||||
return self.__format
|
||||
|
@ -68,12 +68,14 @@ class RemoveDomainConfigScreen(DomainListConfigScreen):
|
||||
return False
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
self.__confirm_remove = snack.Checkbox("Check here to confirm undefining %s." % self.get_selected_domain().get_name(), 0)
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__confirm_remove, 0, 0)
|
||||
return [grid]
|
||||
|
||||
def get_remove_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(snack.Label("%s has been removed." % self.get_selected_domain().get_name()), 0, 0)
|
||||
return [grid]
|
||||
|
@ -55,6 +55,7 @@ class RemoveHostConfigScreen(HostListConfigScreen):
|
||||
self.set_finished()
|
||||
|
||||
def get_confirm_remove_page(self, screen):
|
||||
ignore = screen
|
||||
self.__confirm = snack.Checkbox("Remove this connection: %s" % self.get_selected_connection(), 0)
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__confirm, 0, 0)
|
||||
|
@ -36,6 +36,7 @@ class RemoveStoragePoolConfigScreen(StorageListConfigScreen):
|
||||
return page is LIST_POOLS_PAGE and self.has_selectable_pools()
|
||||
|
||||
def page_has_back(self, page):
|
||||
ignore = page
|
||||
return False
|
||||
|
||||
def page_has_finish(self, page):
|
||||
@ -61,6 +62,7 @@ class RemoveStoragePoolConfigScreen(StorageListConfigScreen):
|
||||
self.set_finished()
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
self.__confirm = snack.Checkbox("Check here to confirm deleting pool: %s" % self.get_selected_pool())
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__confirm, 0, 0)
|
||||
|
@ -17,10 +17,7 @@
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
import traceback
|
||||
|
||||
import utils
|
||||
from createmeter import CreateMeter
|
||||
from configscreen import StorageListConfigScreen
|
||||
from volumeconfig import StorageVolumeConfig
|
||||
|
||||
@ -65,6 +62,7 @@ class RemoveVolumeConfigScreen(StorageListConfigScreen):
|
||||
return page is CONFIRM_PAGE
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
self.__confirm = snack.Checkbox("Check here to confirm deleting volume: %s" % self.get_selected_volume())
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(self.__confirm, 0, 0)
|
||||
|
@ -59,6 +59,7 @@ class StartDomainConfigScreen(DomainListConfigScreen):
|
||||
errors.append("You must first select a domain to start.")
|
||||
|
||||
def get_start_domain_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(snack.Label("%s was successfully started." % self.get_selected_domain().get_name()), 0, 0)
|
||||
return [grid]
|
||||
|
@ -48,6 +48,7 @@ class StartNetworkConfigScreen(NetworkListConfigScreen):
|
||||
return True
|
||||
|
||||
def get_start_network_page(self, screen):
|
||||
ignore = screen
|
||||
network = self.get_selected_network()
|
||||
return [snack.Label("%s was successfully started." % network.get_name())]
|
||||
|
||||
|
@ -36,6 +36,7 @@ class StartStoragePoolConfigScreen(StorageListConfigScreen):
|
||||
return page is LIST_POOLS_PAGE and self.has_selectable_pools()
|
||||
|
||||
def page_has_back(self, page):
|
||||
ignore = page
|
||||
return False
|
||||
|
||||
def page_has_finish(self, page):
|
||||
@ -55,6 +56,7 @@ class StartStoragePoolConfigScreen(StorageListConfigScreen):
|
||||
self.set_finished()
|
||||
|
||||
def get_final_page(self, screen):
|
||||
ignore = screen
|
||||
return [snack.Label("Storage pool started: %s" % self.get_selected_pool())]
|
||||
|
||||
def StartStoragePool():
|
||||
|
@ -60,6 +60,7 @@ class StopDomainConfigScreen(DomainListConfigScreen):
|
||||
return False
|
||||
|
||||
def get_stop_page(self, screen):
|
||||
ignore = screen
|
||||
grid = snack.Grid(1, 1)
|
||||
grid.setField(snack.Label("%s was successfully stopped." % self.get_selected_domain().get_name()), 0, 0)
|
||||
return [grid]
|
||||
|
@ -48,6 +48,7 @@ class StopNetworkConfigScreen(NetworkListConfigScreen):
|
||||
return False
|
||||
|
||||
def get_stop_network_page(self, screen):
|
||||
ignore = screen
|
||||
network = self.get_selected_network()
|
||||
return [snack.Label("%s has been stopped." % network.get_name())]
|
||||
|
||||
|
@ -36,6 +36,7 @@ class StopStoragePoolConfigScreen(StorageListConfigScreen):
|
||||
return page is LIST_POOLS_PAGE and self.has_selectable_pools()
|
||||
|
||||
def page_has_back(self, page):
|
||||
ignore = page
|
||||
return False
|
||||
|
||||
def page_has_finish(self, page):
|
||||
@ -55,6 +56,7 @@ class StopStoragePoolConfigScreen(StorageListConfigScreen):
|
||||
self.set_finished()
|
||||
|
||||
def get_final_page(self, screen):
|
||||
ignore = screen
|
||||
return [snack.Label("Storage pool stopped: %s" % self.get_selected_pool())]
|
||||
|
||||
def StopStoragePool():
|
||||
|
@ -16,9 +16,6 @@
|
||||
# MA 02110-1301, USA. A copy of the GNU General Public License is
|
||||
# also available at http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
import snack
|
||||
import traceback
|
||||
|
||||
from menuscreen import MenuScreen
|
||||
from addpool import AddStoragePool
|
||||
from startpool import StartStoragePool
|
||||
|
@ -62,6 +62,7 @@ class UndefineNetworkConfigScreen(NetworkListConfigScreen):
|
||||
return False
|
||||
|
||||
def get_confirm_page(self, screen):
|
||||
ignore = screen
|
||||
network = self.get_selected_network()
|
||||
self.__confirm_undefine = snack.Checkbox("Check here to confirm undefining %s." % network.get_name())
|
||||
grid = snack.Grid(1, 1)
|
||||
@ -69,6 +70,7 @@ class UndefineNetworkConfigScreen(NetworkListConfigScreen):
|
||||
return [grid]
|
||||
|
||||
def get_undefine_network_page(self, screen):
|
||||
ignore = screen
|
||||
network_name = self.__deleted_network_name
|
||||
return [snack.Label("Network has been undefined: %s" % network_name)]
|
||||
|
||||
|
@ -64,8 +64,8 @@ class StorageVolumeConfig:
|
||||
self.__formats = self.__volume_class.formats
|
||||
return self.__formats
|
||||
|
||||
def set_format(self, format):
|
||||
self.__format = format
|
||||
def set_format(self, fmt):
|
||||
self.__format = fmt
|
||||
|
||||
def get_format(self):
|
||||
return self.__format
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
# pylint doesn't work well with a file named xxx.py.xxx
|
||||
cp src/virt-manager.py.in src/_virt-manager
|
||||
cp src/virt-manager-tui.py.in src/_virt-manager-tui
|
||||
|
||||
cd src || exit 1
|
||||
|
||||
@ -11,7 +12,7 @@ IGNOREFILES="IPy.py"
|
||||
# pylint Section #
|
||||
##################
|
||||
|
||||
PYLINT_FILES="virtManager/ _virt-manager"
|
||||
PYLINT_FILES="virtManager/ _virt-manager virtManagerTui/ _virt-manager-tui"
|
||||
|
||||
# Deliberately ignored warnings:
|
||||
# Don't print pylint config warning
|
||||
@ -150,3 +151,4 @@ pep8 -r --exclude=$IGNOREFILES --ignore $SKIP_PEP8 \
|
||||
|
||||
cd - > /dev/null
|
||||
rm src/_virt-manager
|
||||
rm src/_virt-manager-tui
|
||||
|
Loading…
x
Reference in New Issue
Block a user