pycodestyle: fix all E203 warnings

Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
This commit is contained in:
Chen Hanxiao 2017-08-05 14:39:32 +08:00 committed by Chen Hanxiao
parent 34c80e56cd
commit c92aade081
41 changed files with 350 additions and 351 deletions

View File

@ -673,8 +673,8 @@ distutils.core.setup(
'rpm': my_rpm,
'test': TestCommand,
'test_ui': TestUI,
'test_urls' : TestURLFetch,
'test_initrd_inject' : TestInitrdInject,
'test_urls': TestURLFetch,
'test_initrd_inject': TestInitrdInject,
},
distclass=VMMDistribution,

View File

@ -75,43 +75,43 @@ test_files = {
'URI-KVM-SESSION': utils.uri_kvm_session,
'URI-KVM-REMOTE': utils.uri_kvm + ",remote",
'URI-KVM-NODOMCAPS': utils.uri_kvm_nodomcaps,
'URI-KVM-ARMV7L' : utils.uri_kvm_armv7l,
'URI-KVM-AARCH64' : utils.uri_kvm_aarch64,
'URI-KVM-PPC64LE' : utils.uri_kvm_ppc64le,
'URI-KVM-S390X' : utils.uri_kvm_s390x,
'URI-KVM-S390X-KVMIBM' : utils.uri_kvm_s390x_KVMIBM,
'URI-KVM-ARMV7L': utils.uri_kvm_armv7l,
'URI-KVM-AARCH64': utils.uri_kvm_aarch64,
'URI-KVM-PPC64LE': utils.uri_kvm_ppc64le,
'URI-KVM-S390X': utils.uri_kvm_s390x,
'URI-KVM-S390X-KVMIBM': utils.uri_kvm_s390x_KVMIBM,
'URI-XEN': utils.uri_xen,
'URI-LXC': utils.uri_lxc,
'URI-VZ': utils.uri_vz,
'CLONE_DISK_XML' : "%s/clone-disk.xml" % xmldir,
'CLONE_STORAGE_XML' : "%s/clone-disk-managed.xml" % xmldir,
'CLONE_NOEXIST_XML' : "%s/clone-disk-noexist.xml" % xmldir,
'IMAGE_XML' : "%s/image.xml" % xmldir,
'IMAGE_NOGFX_XML' : "%s/image-nogfx.xml" % xmldir,
'OVF_IMG1' : "%s/tests/virtconv-files/ovf_input/test1.ovf" % os.getcwd(),
'VMX_IMG1' : "%s/tests/virtconv-files/vmx_input/test1.vmx" % os.getcwd(),
'CLONE_DISK_XML': "%s/clone-disk.xml" % xmldir,
'CLONE_STORAGE_XML': "%s/clone-disk-managed.xml" % xmldir,
'CLONE_NOEXIST_XML': "%s/clone-disk-noexist.xml" % xmldir,
'IMAGE_XML': "%s/image.xml" % xmldir,
'IMAGE_NOGFX_XML': "%s/image-nogfx.xml" % xmldir,
'OVF_IMG1': "%s/tests/virtconv-files/ovf_input/test1.ovf" % os.getcwd(),
'VMX_IMG1': "%s/tests/virtconv-files/vmx_input/test1.vmx" % os.getcwd(),
'NEWIMG1' : "/dev/default-pool/new1.img",
'NEWIMG2' : "/dev/default-pool/new2.img",
'NEWCLONEIMG1' : new_images[0],
'NEWCLONEIMG2' : new_images[1],
'NEWCLONEIMG3' : new_images[2],
'AUTOMANAGEIMG' : "/some/new/pool/dir/new",
'BLOCKVOL' : '/iscsi-pool/diskvol1',
'EXISTIMG1' : "/dev/default-pool/testvol1.img",
'EXISTIMG2' : "/dev/default-pool/testvol2.img",
'EXISTIMG3' : exist_images[0],
'EXISTIMG4' : exist_images[1],
'EXISTUPPER' : "/dev/default-pool/UPPER",
'POOL' : "default-pool",
'VOL' : "testvol1.img",
'DIR' : "/var",
'TREEDIR' : treedir,
'MANAGEDNEW1' : "/dev/default-pool/clonevol",
'MANAGEDDISKNEW1' : "/dev/disk-pool/newvol1.img",
'COLLIDE' : "/dev/default-pool/collidevol1.img",
'SHARE' : "/dev/default-pool/sharevol.img",
'NEWIMG1': "/dev/default-pool/new1.img",
'NEWIMG2': "/dev/default-pool/new2.img",
'NEWCLONEIMG1': new_images[0],
'NEWCLONEIMG2': new_images[1],
'NEWCLONEIMG3': new_images[2],
'AUTOMANAGEIMG': "/some/new/pool/dir/new",
'BLOCKVOL': '/iscsi-pool/diskvol1',
'EXISTIMG1': "/dev/default-pool/testvol1.img",
'EXISTIMG2': "/dev/default-pool/testvol2.img",
'EXISTIMG3': exist_images[0],
'EXISTIMG4': exist_images[1],
'EXISTUPPER': "/dev/default-pool/UPPER",
'POOL': "default-pool",
'VOL': "testvol1.img",
'DIR': "/var",
'TREEDIR': treedir,
'MANAGEDNEW1': "/dev/default-pool/clonevol",
'MANAGEDDISKNEW1': "/dev/disk-pool/newvol1.img",
'COLLIDE': "/dev/default-pool/collidevol1.img",
'SHARE': "/dev/default-pool/sharevol.img",
}

View File

@ -119,7 +119,7 @@ class TestClone(unittest.TestCase):
def testRemoteNoStorage(self):
"""Test remote clone where VM has no storage that needs cloning"""
conn = utils.open_test_remote()
for base in ["nostorage", "noclone-storage"] :
for base in ["nostorage", "noclone-storage"]:
self._clone_helper(base, disks=[], conn=conn)
def testRemoteWithStorage(self):
@ -128,7 +128,7 @@ class TestClone(unittest.TestCase):
since libvirt has no storage clone api.
"""
conn = utils.open_test_remote()
for base in ["general-cfg"] :
for base in ["general-cfg"]:
try:
self._clone_helper(base,
disks=["%s/1.img" % POOL1,

View File

@ -224,7 +224,7 @@ class TestNodeDev(unittest.TestCase):
devname = "pci_10df_fe00_0_scsi_host"
vals = {"name": "pci_10df_fe00_0_scsi_host",
"device_type": NodeDevice.CAPABILITY_TYPE_SCSIBUS,
"host": "4", "fc_host": True, "vport_ops" : True,
"host": "4", "fc_host": True, "vport_ops": True,
"wwnn": "20000000c9848141", "wwpn": "10000000c9848141"}
self._testCompare(devname, vals)

View File

@ -17,7 +17,6 @@ format = pylint
# E128: Continuation line under-indented for visual indent
# E129: Visually indented line with same indent as next logical line
# E131: Continuation line unaligned for hanging indent
# E203: White-space before ':'
# E221: Multiple spaces before operator
# E241: Multiple spaces after ,
# E301: Expected 1 blank line, found 0
@ -30,4 +29,4 @@ format = pylint
# E741: Do not use variables named l, O, or I
ignore = E122, E123, E124, E125, E126, E127, E128, E129, E131, E203, E221, E241, E301, E303, E305, E306, E402, E501, E741
ignore = E122, E123, E124, E125, E126, E127, E128, E129, E131, E221, E241, E301, E303, E305, E306, E402, E501, E741

View File

@ -439,7 +439,7 @@ def validate_required_options(options, guest):
(not cdrom_specified(guest, options.disk))):
msg += "\n" + (
_("An install method must be specified\n(%(methods)s)") %
{"methods" : install_methods})
{"methods": install_methods})
if msg:
fail(msg)
@ -457,7 +457,7 @@ def check_option_collisions(options, guest):
if sum([bool(l) for l in [options.pxe, options.location,
options.cdrom, options.import_install]]) > 1:
fail(_("Only one install method can be used (%(methods)s)") %
{"methods" : install_methods})
{"methods": install_methods})
if (guest.os.is_container() and
install_specified(options.location, options.cdrom,

View File

@ -93,14 +93,14 @@ class vmmAddHardware(vmmGObjectUI):
self.addstorage.connect("browse-clicked", self._browse_storage_cb)
self.builder.connect_signals({
"on_create_cancel_clicked" : self.close,
"on_vmm_create_delete_event" : self.close,
"on_create_finish_clicked" : self._finish,
"on_create_cancel_clicked": self.close,
"on_vmm_create_delete_event": self.close,
"on_create_finish_clicked": self._finish,
"on_hw_list_changed": self._hw_selected,
"on_storage_devtype_changed": self._change_storage_devtype,
"on_mac_address_clicked" : self._change_macaddr_use,
"on_mac_address_clicked": self._change_macaddr_use,
"on_char_device_type_changed": self._change_char_device_type,
"on_char_target_name_changed": self._change_char_target_name,
@ -1159,7 +1159,7 @@ class vmmAddHardware(vmmGObjectUI):
return
tpm_widget_mappings = {
"device_path" : "tpm-device-path",
"device_path": "tpm-device-path",
}
self._dev = VirtualTPMDevice(self.conn.get_backend())
@ -1202,12 +1202,12 @@ class vmmAddHardware(vmmGObjectUI):
return
char_widget_mappings = {
"source_path" : "char-path",
"source_channel" : "char-channel",
"source_mode" : "char-mode",
"source_host" : "char-host",
"bind_host" : "char-bind-host",
"protocol" : "char-use-telnet",
"source_path": "char-path",
"source_channel": "char-channel",
"source_mode": "char-mode",
"source_host": "char-host",
"bind_host": "char-bind-host",
"protocol": "char-use-telnet",
}
char_class = self._get_char_class()
@ -1653,11 +1653,11 @@ class vmmAddHardware(vmmGObjectUI):
source_host = source_port = source_mode = None
value_mappings = {
"source_path" : source_path,
"source_channel" : source_channel,
"source_mode" : source_mode,
"source_host" : source_host,
"source_port" : source_port,
"source_path": source_path,
"source_channel": source_channel,
"source_mode": source_mode,
"source_host": source_host,
"source_port": source_port,
"bind_port": bind_port,
"bind_host": bind_host,
"protocol": protocol,
@ -1743,7 +1743,7 @@ class vmmAddHardware(vmmGObjectUI):
device_path = self.widget("tpm-device-path").get_text()
value_mappings = {
"device_path" : device_path,
"device_path": device_path,
}
try:
@ -1761,7 +1761,7 @@ class vmmAddHardware(vmmGObjectUI):
iobase = self.widget("panic-iobase").get_text()
value_mappings = {
"iobase" : iobase,
"iobase": iobase,
}
try:
@ -1848,13 +1848,13 @@ class vmmAddHardware(vmmGObjectUI):
_("The EGD service must be specified."))
value_mappings = {
"backend_type" : backend_type,
"backend_source_mode" : backend_mode,
"connect_host" : connect_host,
"connect_service" : connect_service,
"bind_host" : bind_host,
"bind_service" : bind_service,
"device" : device,
"backend_type": backend_type,
"backend_source_mode": backend_mode,
"connect_host": connect_host,
"connect_service": connect_service,
"bind_host": bind_host,
"bind_service": bind_service,
"device": device,
}
try:

View File

@ -194,8 +194,8 @@ class vmmAsyncJob(vmmGObjectUI):
self._bg_thread.daemon = True
self.builder.connect_signals({
"on_async_job_delete_event" : self._on_window_delete,
"on_async_job_cancel_clicked" : self._on_cancel,
"on_async_job_delete_event": self._on_window_delete,
"on_async_job_cancel_clicked": self._on_cancel,
})
# UI state

View File

@ -154,22 +154,22 @@ class vmmCloneVM(vmmGObjectUI):
self.change_storage.set_transient_for(self.topwin)
self.builder.connect_signals({
"on_clone_delete_event" : self.close,
"on_clone_cancel_clicked" : self.close,
"on_clone_ok_clicked" : self.finish,
"on_clone_delete_event": self.close,
"on_clone_cancel_clicked": self.close,
"on_clone_ok_clicked": self.finish,
# Change mac dialog
"on_vmm_change_mac_delete_event": self.change_mac_close,
"on_change_mac_cancel_clicked" : self.change_mac_close,
"on_change_mac_ok_clicked" : self.change_mac_finish,
"on_change_mac_cancel_clicked": self.change_mac_close,
"on_change_mac_ok_clicked": self.change_mac_finish,
# Change storage dialog
"on_vmm_change_storage_delete_event": self.change_storage_close,
"on_change_storage_cancel_clicked" : self.change_storage_close,
"on_change_storage_ok_clicked" : self.change_storage_finish,
"on_change_storage_doclone_toggled" : self.change_storage_doclone_toggled,
"on_change_storage_cancel_clicked": self.change_storage_close,
"on_change_storage_ok_clicked": self.change_storage_finish,
"on_change_storage_doclone_toggled": self.change_storage_doclone_toggled,
"on_change_storage_browse_clicked" : self.change_storage_browse,
"on_change_storage_browse_clicked": self.change_storage_browse,
})
self.bind_escape_key_close()

View File

@ -122,31 +122,31 @@ class vmmConfig(object):
# Metadata mapping for browse types. Prob shouldn't go here, but works
# for now.
browse_reason_data = {
CONFIG_DIR_IMAGE : {
"enable_create" : True,
"storage_title" : _("Locate or create storage volume"),
"local_title" : _("Locate existing storage"),
"dialog_type" : Gtk.FileChooserAction.SAVE,
"choose_button" : Gtk.STOCK_OPEN,
CONFIG_DIR_IMAGE: {
"enable_create": True,
"storage_title": _("Locate or create storage volume"),
"local_title": _("Locate existing storage"),
"dialog_type": Gtk.FileChooserAction.SAVE,
"choose_button": Gtk.STOCK_OPEN,
},
CONFIG_DIR_ISO_MEDIA : {
"enable_create" : False,
"storage_title" : _("Locate ISO media volume"),
"local_title" : _("Locate ISO media"),
CONFIG_DIR_ISO_MEDIA: {
"enable_create": False,
"storage_title": _("Locate ISO media volume"),
"local_title": _("Locate ISO media"),
},
CONFIG_DIR_FLOPPY_MEDIA : {
"enable_create" : False,
"storage_title" : _("Locate floppy media volume"),
"local_title" : _("Locate floppy media"),
CONFIG_DIR_FLOPPY_MEDIA: {
"enable_create": False,
"storage_title": _("Locate floppy media volume"),
"local_title": _("Locate floppy media"),
},
CONFIG_DIR_FS : {
"enable_create" : False,
"storage_title" : _("Locate directory volume"),
"local_title" : _("Locate directory volume"),
"dialog_type" : Gtk.FileChooserAction.SELECT_FOLDER,
CONFIG_DIR_FS: {
"enable_create": False,
"storage_title": _("Locate directory volume"),
"local_title": _("Locate directory volume"),
"dialog_type": Gtk.FileChooserAction.SELECT_FOLDER,
},
}
@ -713,7 +713,7 @@ class vmmConfig(object):
return
secret = vmmSecret(self.get_secret_name(vm), password,
{"uuid" : vm.get_uuid(),
{"uuid": vm.get_uuid(),
"hvuri": vm.conn.get_uri()})
keyid = self.keyring.add_secret(secret)
if keyid is None:

View File

@ -420,19 +420,19 @@ class vmmConnection(vmmGObject):
return self._get_config_pretty_name()
pretty_map = {
"esx" : "ESX",
"gsx" : "GSX",
"libxl" : "libxl",
"lxc" : "LXC",
"openvz" : "OpenVZ",
"phyp" : "phyp",
"qemu" : "QEMU/KVM",
"test" : "test",
"uml" : "UML",
"vbox" : "VBox",
"vmware" : "VMWare",
"xen" : "Xen",
"xenapi" : "XenAPI",
"esx": "ESX",
"gsx": "GSX",
"libxl": "libxl",
"lxc": "LXC",
"openvz": "OpenVZ",
"phyp": "phyp",
"qemu": "QEMU/KVM",
"test": "test",
"uml": "UML",
"vbox": "VBox",
"vmware": "VMWare",
"xen": "Xen",
"xenapi": "XenAPI",
}
hv = pretty_map.get(self.get_driver(), self.get_driver())
@ -1404,12 +1404,12 @@ class vmmConnection(vmmGObject):
"memoryPercent": pcentMem,
"cpuTime": cpuTime,
"cpuHostPercent": pcentHostCpu,
"diskRdRate" : rdRate,
"diskWrRate" : wrRate,
"netRxRate" : rxRate,
"netTxRate" : txRate,
"diskMaxRate" : diskMaxRate,
"netMaxRate" : netMaxRate,
"diskRdRate": rdRate,
"diskWrRate": wrRate,
"netRxRate": rxRate,
"netTxRate": txRate,
"diskMaxRate": diskMaxRate,
"netMaxRate": netMaxRate,
}
self._stats.insert(0, newStats)

View File

@ -150,12 +150,12 @@ class vmmCreate(vmmGObjectUI):
self._addstorage.connect("browse-clicked", _browse_file_cb)
self.builder.connect_signals({
"on_vmm_newcreate_delete_event" : self._close_requested,
"on_vmm_newcreate_delete_event": self._close_requested,
"on_create_cancel_clicked": self._close_requested,
"on_create_back_clicked" : self._back_clicked,
"on_create_forward_clicked" : self._forward_clicked,
"on_create_finish_clicked" : self._finish_clicked,
"on_create_back_clicked": self._back_clicked,
"on_create_forward_clicked": self._forward_clicked,
"on_create_finish_clicked": self._finish_clicked,
"on_create_pages_switch_page": self._page_changed,
"on_create_conn_changed": self._conn_changed,

View File

@ -77,12 +77,12 @@ class vmmCreateInterface(vmmGObjectUI):
self.ip_manually_changed = False
self.builder.connect_signals({
"on_vmm_create_interface_delete_event" : self.close,
"on_vmm_create_interface_delete_event": self.close,
"on_cancel_clicked": self.close,
"on_back_clicked" : self.back,
"on_forward_clicked" : self.forward,
"on_finish_clicked" : self.finish,
"on_back_clicked": self.back,
"on_forward_clicked": self.forward,
"on_finish_clicked": self.finish,
"on_pages_switch_page": self.page_changed,
"on_bridge_config_button_clicked": self.show_bridge_config,
@ -92,7 +92,7 @@ class vmmCreateInterface(vmmGObjectUI):
# Bridge config dialog
"on_bridge_config_delete_event": self.bridge_config_finish,
"on_bridge_ok_clicked" : self.bridge_config_finish,
"on_bridge_ok_clicked": self.bridge_config_finish,
# IP config dialog
"on_ip_config_delete_event": self.ip_config_finish,
@ -109,7 +109,7 @@ class vmmCreateInterface(vmmGObjectUI):
# Bond config dialog
"on_bond_config_delete_event": self.bond_config_finish,
"on_bond_ok_clicked" : self.bond_config_finish,
"on_bond_ok_clicked": self.bond_config_finish,
"on_bond_monitor_mode_changed": self.bond_monitor_mode_changed,
})
@ -382,9 +382,9 @@ class vmmCreateInterface(vmmGObjectUI):
# Make sure interface type specific fields are shown
type_dict = {
Interface.INTERFACE_TYPE_BRIDGE : "bridge",
Interface.INTERFACE_TYPE_BOND : "bond",
Interface.INTERFACE_TYPE_VLAN : "vlan",
Interface.INTERFACE_TYPE_BRIDGE: "bridge",
Interface.INTERFACE_TYPE_BOND: "bond",
Interface.INTERFACE_TYPE_VLAN: "vlan",
}
for key, value in type_dict.items():

View File

@ -60,24 +60,24 @@ class vmmCreateNetwork(vmmGObjectUI):
self.conn = conn
self.builder.connect_signals({
"on_create_pages_switch_page" : self.page_changed,
"on_create_cancel_clicked" : self.close,
"on_vmm_create_delete_event" : self.close,
"on_create_forward_clicked" : self.forward,
"on_create_back_clicked" : self.back,
"on_create_finish_clicked" : self.finish,
"on_create_pages_switch_page": self.page_changed,
"on_create_cancel_clicked": self.close,
"on_vmm_create_delete_event": self.close,
"on_create_forward_clicked": self.forward,
"on_create_back_clicked": self.back,
"on_create_finish_clicked": self.finish,
"on_net_name_activate": self.forward,
"on_net_forward_toggled" : self.change_forward_type,
"on_net_forward_mode_toggled" : self.change_forward_mode_type,
"on_net_forward_toggled": self.change_forward_type,
"on_net_forward_mode_toggled": self.change_forward_mode_type,
"on_net-ipv4-enable_toggled" : self.change_ipv4_enable,
"on_net-ipv4-enable_toggled": self.change_ipv4_enable,
"on_net-ipv4-network_changed": self.change_ipv4_network,
"on_net-dhcpv4-enable_toggled": self.change_dhcpv4_enable,
"on_net-dhcpv4-start_changed": self.change_dhcpv4_start,
"on_net-dhcpv4-end_changed": self.change_dhcpv4_end,
"on_net-ipv6-enable_toggled" : self.change_ipv6_enable,
"on_net-ipv6-enable_toggled": self.change_ipv6_enable,
"on_net-ipv6-network_changed": self.change_ipv6_network,
"on_net-dhcpv6-enable_toggled": self.change_dhcpv6_enable,
"on_net-dhcpv6-start_changed": self.change_dhcpv6_start,

View File

@ -46,18 +46,18 @@ class vmmCreatePool(vmmGObjectUI):
self._pool = None
self.builder.connect_signals({
"on_pool_forward_clicked" : self.forward,
"on_pool_back_clicked" : self.back,
"on_pool_cancel_clicked" : self.close,
"on_vmm_create_pool_delete_event" : self.close,
"on_pool_finish_clicked" : self.forward,
"on_pool_pages_change_page" : self.page_changed,
"on_pool_forward_clicked": self.forward,
"on_pool_back_clicked": self.back,
"on_pool_cancel_clicked": self.close,
"on_vmm_create_pool_delete_event": self.close,
"on_pool_finish_clicked": self.forward,
"on_pool_pages_change_page": self.page_changed,
"on_pool_source_button_clicked" : self.browse_source_path,
"on_pool_target_button_clicked" : self.browse_target_path,
"on_pool_source_button_clicked": self.browse_source_path,
"on_pool_target_button_clicked": self.browse_target_path,
"on_pool_name_activate": self.forward,
"on_pool_hostname_activate" : self.hostname_changed,
"on_pool_hostname_activate": self.hostname_changed,
"on_pool_iqn_chk_toggled": self.iqn_toggled,
})
self.bind_escape_key_close()

View File

@ -46,16 +46,16 @@ class vmmCreateVolume(vmmGObjectUI):
self.storage_browser = None
self.builder.connect_signals({
"on_vmm_create_vol_delete_event" : self.close,
"on_vol_cancel_clicked" : self.close,
"on_vol_create_clicked" : self.finish,
"on_vmm_create_vol_delete_event": self.close,
"on_vol_cancel_clicked": self.close,
"on_vol_create_clicked": self.finish,
"on_vol_name_changed" : self.vol_name_changed,
"on_vol_format_changed" : self.vol_format_changed,
"on_backing_store_changed" : self._show_alloc,
"on_vol_allocation_value_changed" : self.vol_allocation_changed,
"on_vol_capacity_value_changed" : self.vol_capacity_changed,
"on_backing_browse_clicked" : self.browse_backing,
"on_vol_name_changed": self.vol_name_changed,
"on_vol_format_changed": self.vol_format_changed,
"on_backing_store_changed": self._show_alloc,
"on_vol_allocation_value_changed": self.vol_allocation_changed,
"on_vol_capacity_value_changed": self.vol_capacity_changed,
"on_backing_browse_clicked": self.browse_backing,
})
self.bind_escape_key_close()

View File

@ -51,10 +51,10 @@ class vmmDeleteDialog(vmmGObjectUI):
self.conn = None
self.builder.connect_signals({
"on_vmm_delete_delete_event" : self.close,
"on_delete_cancel_clicked" : self.close,
"on_delete_ok_clicked" : self.finish,
"on_delete_remove_storage_toggled" : self.toggle_remove_storage,
"on_vmm_delete_delete_event": self.close,
"on_delete_cancel_clicked": self.close,
"on_delete_ok_clicked": self.finish,
"on_delete_remove_storage_toggled": self.toggle_remove_storage,
})
self.bind_escape_key_close()

View File

@ -519,8 +519,8 @@ class vmmDetails(vmmGObjectUI):
"on_boot_list_changed": self.config_bootdev_selected,
"on_boot_moveup_clicked" : lambda *x: self.config_boot_move(x, True),
"on_boot_movedown_clicked" : lambda *x: self.config_boot_move(x, False),
"on_boot_moveup_clicked": lambda *x: self.config_boot_move(x, True),
"on_boot_movedown_clicked": lambda *x: self.config_boot_move(x, False),
"on_boot_autostart_changed": lambda *x: self.enable_apply(x, x, EDIT_AUTOSTART),
"on_boot_menu_changed": lambda *x: self.enable_apply(x, EDIT_BOOTMENU),
"on_boot_kernel_enable_toggled": self.boot_kernel_toggled,
@ -745,7 +745,7 @@ class vmmDetails(vmmGObjectUI):
rmHW.show()
rmHW.connect("activate", self.remove_xml_dev)
self._addhwmenuitems = {"add" : addHW, "remove" : rmHW}
self._addhwmenuitems = {"add": addHW, "remove": rmHW}
for i in self._addhwmenuitems.values():
self.addhwmenu.add(i)
@ -2473,7 +2473,7 @@ class vmmDetails(vmmGObjectUI):
pos = summary.find("\n")
if pos > -1:
summary = _("%(summary)s ...") % {
"summary" : summary[0:pos]
"summary": summary[0:pos]
}
apps_model.append([name, version, summary])
@ -2813,20 +2813,20 @@ class vmmDetails(vmmGObjectUI):
def refresh_rng_page(self):
dev = self.get_hw_selection(HW_LIST_COL_DEVICE)
values = {
"rng-bind-host" : "bind_host",
"rng-bind-service" : "bind_service",
"rng-connect-host" : "connect_host",
"rng-connect-service" : "connect_service",
"rng-type" : "type",
"rng-device" : "device",
"rng-backend-type" : "backend_type",
"rng-rate-bytes" : "rate_bytes",
"rng-rate-period" : "rate_period"
"rng-bind-host": "bind_host",
"rng-bind-service": "bind_service",
"rng-connect-host": "connect_host",
"rng-connect-service": "connect_service",
"rng-type": "type",
"rng-device": "device",
"rng-backend-type": "backend_type",
"rng-rate-bytes": "rate_bytes",
"rng-rate-period": "rate_period"
}
rewriter = {
"rng-type" : lambda x:
"rng-type": lambda x:
VirtualRNGDevice.get_pretty_type(x),
"rng-backend-type" : lambda x:
"rng-backend-type": lambda x:
VirtualRNGDevice.get_pretty_backend_type(x),
}

View File

@ -57,27 +57,27 @@ class _SENTINEL(object):
def compare_device(origdev, newdev, idx):
devprops = {
"disk" : ["target", "bus"],
"interface" : ["macaddr", "vmmindex"],
"input" : ["bus", "type", "vmmindex"],
"sound" : ["model", "vmmindex"],
"video" : ["model", "vmmindex"],
"watchdog" : ["vmmindex"],
"hostdev" : ["type", "managed", "vmmindex",
"product", "vendor",
"function", "domain", "slot"],
"serial" : ["type", "target_port"],
"parallel" : ["type", "target_port"],
"console" : ["type", "target_type", "target_port"],
"graphics" : ["type", "vmmindex"],
"controller" : ["type", "index"],
"channel" : ["type", "target_name"],
"filesystem" : ["target" , "vmmindex"],
"smartcard" : ["mode" , "vmmindex"],
"redirdev" : ["bus" , "type", "vmmindex"],
"tpm" : ["type" , "vmmindex"],
"rng" : ["type" , "vmmindex"],
"panic" : ["type" , "vmmindex"],
"disk": ["target", "bus"],
"interface": ["macaddr", "vmmindex"],
"input": ["bus", "type", "vmmindex"],
"sound": ["model", "vmmindex"],
"video": ["model", "vmmindex"],
"watchdog": ["vmmindex"],
"hostdev": ["type", "managed", "vmmindex",
"product", "vendor",
"function", "domain", "slot"],
"serial": ["type", "target_port"],
"parallel": ["type", "target_port"],
"console": ["type", "target_type", "target_port"],
"graphics": ["type", "vmmindex"],
"controller": ["type", "index"],
"channel": ["type", "target_name"],
"filesystem": ["target", "vmmindex"],
"smartcard": ["mode", "vmmindex"],
"redirdev": ["bus", "type", "vmmindex"],
"tpm": ["type", "vmmindex"],
"rng": ["type", "vmmindex"],
"panic": ["type", "vmmindex"],
}
if id(origdev) == id(newdev):
@ -260,43 +260,43 @@ class vmmDomain(vmmLibvirtObject):
def key(x, y):
return getattr(libvirt, "VIR_DOMAIN_" + x, y)
reasons = {
libvirt.VIR_DOMAIN_RUNNING : {
key("RUNNING_BOOTED", 1) : _("Booted"),
key("RUNNING_MIGRATED", 2) : _("Migrated"),
key("RUNNING_RESTORED", 3) : _("Restored"),
key("RUNNING_FROM_SNAPSHOT", 4) : _("From snapshot"),
key("RUNNING_UNPAUSED", 5) : _("Unpaused"),
key("RUNNING_MIGRATION_CANCELED", 6) : _("Migration canceled"),
key("RUNNING_SAVE_CANCELED", 7) : _("Save canceled"),
key("RUNNING_WAKEUP", 8) : _("Event wakeup"),
key("RUNNING_CRASHED", 9) : _("Crashed"),
libvirt.VIR_DOMAIN_RUNNING: {
key("RUNNING_BOOTED", 1): _("Booted"),
key("RUNNING_MIGRATED", 2): _("Migrated"),
key("RUNNING_RESTORED", 3): _("Restored"),
key("RUNNING_FROM_SNAPSHOT", 4): _("From snapshot"),
key("RUNNING_UNPAUSED", 5): _("Unpaused"),
key("RUNNING_MIGRATION_CANCELED", 6): _("Migration canceled"),
key("RUNNING_SAVE_CANCELED", 7): _("Save canceled"),
key("RUNNING_WAKEUP", 8): _("Event wakeup"),
key("RUNNING_CRASHED", 9): _("Crashed"),
},
libvirt.VIR_DOMAIN_PAUSED : {
key("PAUSED_USER", 1) : _("User"),
key("PAUSED_MIGRATION", 2) : _("Migrating"),
key("PAUSED_SAVE", 3) : _("Saving"),
key("PAUSED_DUMP", 4) : _("Dumping"),
key("PAUSED_IOERROR", 5) : _("I/O error"),
key("PAUSED_WATCHDOG", 6) : _("Watchdog"),
key("PAUSED_FROM_SNAPSHOT", 7) : _("From snapshot"),
key("PAUSED_SHUTTING_DOWN", 8) : _("Shutting down"),
key("PAUSED_SNAPSHOT", 9) : _("Creating snapshot"),
key("PAUSED_CRASHED", 10) : _("Crashed"),
libvirt.VIR_DOMAIN_PAUSED: {
key("PAUSED_USER", 1): _("User"),
key("PAUSED_MIGRATION", 2): _("Migrating"),
key("PAUSED_SAVE", 3): _("Saving"),
key("PAUSED_DUMP", 4): _("Dumping"),
key("PAUSED_IOERROR", 5): _("I/O error"),
key("PAUSED_WATCHDOG", 6): _("Watchdog"),
key("PAUSED_FROM_SNAPSHOT", 7): _("From snapshot"),
key("PAUSED_SHUTTING_DOWN", 8): _("Shutting down"),
key("PAUSED_SNAPSHOT", 9): _("Creating snapshot"),
key("PAUSED_CRASHED", 10): _("Crashed"),
},
libvirt.VIR_DOMAIN_SHUTDOWN : {
key("SHUTDOWN_USER", 1) : _("User"),
libvirt.VIR_DOMAIN_SHUTDOWN: {
key("SHUTDOWN_USER", 1): _("User"),
},
libvirt.VIR_DOMAIN_SHUTOFF : {
key("SHUTOFF_SHUTDOWN", 1) : _("Shut Down"),
key("SHUTOFF_DESTROYED", 2) : _("Destroyed"),
key("SHUTOFF_CRASHED", 3) : _("Crashed"),
key("SHUTOFF_MIGRATED", 4) : _("Migrated"),
key("SHUTOFF_SAVED", 5) : _("Saved"),
key("SHUTOFF_FAILED", 6) : _("Failed"),
key("SHUTOFF_FROM_SNAPSHOT", 7) : _("From snapshot"),
libvirt.VIR_DOMAIN_SHUTOFF: {
key("SHUTOFF_SHUTDOWN", 1): _("Shut Down"),
key("SHUTOFF_DESTROYED", 2): _("Destroyed"),
key("SHUTOFF_CRASHED", 3): _("Crashed"),
key("SHUTOFF_MIGRATED", 4): _("Migrated"),
key("SHUTOFF_SAVED", 5): _("Saved"),
key("SHUTOFF_FAILED", 6): _("Failed"),
key("SHUTOFF_FROM_SNAPSHOT", 7): _("From snapshot"),
},
libvirt.VIR_DOMAIN_CRASHED : {
key("CRASHED_PANICKED", 1) : _("Panicked"),
libvirt.VIR_DOMAIN_CRASHED: {
key("CRASHED_PANICKED", 1): _("Panicked"),
}
}
return reasons.get(status) and reasons[status].get(reason)
@ -308,10 +308,10 @@ class vmmDomain(vmmLibvirtObject):
self._stats = []
self._stats_rates = {
"diskRdRate" : 10.0,
"diskWrRate" : 10.0,
"netTxRate" : 10.0,
"netRxRate" : 10.0,
"diskRdRate": 10.0,
"diskWrRate": 10.0,
"netTxRate": 10.0,
"netRxRate": 10.0,
}
self._install_abort = False

View File

@ -207,7 +207,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
is_sdl = (gtype == "sdl")
is_spice = (gtype == "spice")
title = (_("%(graphicstype)s Server") %
{"graphicstype" : gfx.pretty_type_simple(gtype)})
{"graphicstype": gfx.pretty_type_simple(gtype)})
if is_vnc or is_spice:
use_passwd = gfx.passwd is not None

View File

@ -100,11 +100,11 @@ def draw_fill(cairo_ct, x, y, w, h, points, taper=False):
class CellRendererSparkline(Gtk.CellRenderer):
__gproperties__ = {
# 'name' : (GObject.TYPE_*,
# 'name': (GObject.TYPE_*,
# nickname, long desc, (type related args), mode)
# Type related args can be min, max for int (etc.), or default value
# for strings and bool
'data_array' : (GObject.TYPE_PYOBJECT, "Data Array",
'data_array': (GObject.TYPE_PYOBJECT, "Data Array",
"Array of data points for the graph",
GObject.PARAM_READWRITE),
'reversed': (GObject.TYPE_BOOLEAN, "Reverse data",
@ -269,11 +269,11 @@ class CellRendererSparkline(Gtk.CellRenderer):
class Sparkline(Gtk.DrawingArea):
__gproperties__ = {
# 'name' : (GObject.TYPE_*,
# 'name': (GObject.TYPE_*,
# nickname, long desc, (type related args), mode)
# Type related args can be min, max for int (etc.), or default value
# for strings and bool
'data_array' : (GObject.TYPE_PYOBJECT, "Data Array",
'data_array': (GObject.TYPE_PYOBJECT, "Data Array",
"Array of data points for the graph",
GObject.PARAM_READWRITE),
'filled': (GObject.TYPE_BOOLEAN, 'Filled', 'the foo of the object',

View File

@ -80,8 +80,8 @@ class vmmHost(vmmGObjectUI):
self.init_interface_state()
self.builder.connect_signals({
"on_menu_file_view_manager_activate" : self.view_manager,
"on_menu_file_quit_activate" : self.exit_app,
"on_menu_file_view_manager_activate": self.view_manager,
"on_menu_file_quit_activate": self.exit_app,
"on_menu_file_close_activate": self.close,
"on_vmm_host_delete_event": self.close,
"on_host_page_switch": self.page_changed,
@ -98,12 +98,12 @@ class vmmHost(vmmGObjectUI):
"on_net_name_changed": (lambda *x:
self.enable_net_apply(x, EDIT_NET_NAME)),
"on_interface_add_clicked" : self.add_interface,
"on_interface_start_clicked" : self.start_interface,
"on_interface_stop_clicked" : self.stop_interface,
"on_interface_delete_clicked" : self.delete_interface,
"on_interface_add_clicked": self.add_interface,
"on_interface_start_clicked": self.start_interface,
"on_interface_stop_clicked": self.stop_interface,
"on_interface_delete_clicked": self.delete_interface,
"on_interface_startmode_changed": self.interface_startmode_changed,
"on_interface_apply_clicked" : (lambda *x: self.interface_apply()),
"on_interface_apply_clicked": (lambda *x: self.interface_apply()),
"on_interface_list_changed": self.interface_selected,
"on_overview_name_changed": self._overview_name_changed,

View File

@ -72,8 +72,8 @@ class vmmKeyring(object):
ret = None
try:
props = {
"org.freedesktop.Secret.Item.Label" : GLib.Variant("s", secret.get_name()),
"org.freedesktop.Secret.Item.Attributes" : GLib.Variant("a{ss}", secret.attributes),
"org.freedesktop.Secret.Item.Label": GLib.Variant("s", secret.get_name()),
"org.freedesktop.Secret.Item.Attributes": GLib.Variant("a{ss}", secret.attributes),
}
params = (self._session, [],
[ord(v) for v in secret.get_secret()],

View File

@ -132,7 +132,7 @@ class vmmManager(vmmGObjectUI):
self.toggle_stats_visible_host_cpu,
"on_menu_view_memory_usage_activate":
self.toggle_stats_visible_memory_usage,
"on_menu_view_disk_io_activate" :
"on_menu_view_disk_io_activate":
self.toggle_stats_visible_disk,
"on_menu_view_network_traffic_activate":
self.toggle_stats_visible_network,

View File

@ -47,14 +47,14 @@ class vmmMigrateDialog(vmmGObjectUI):
self._conns = {}
self.builder.connect_signals({
"on_vmm_migrate_delete_event" : self._delete_event,
"on_migrate_cancel_clicked" : self._cancel_clicked,
"on_migrate_finish_clicked" : self._finish_clicked,
"on_vmm_migrate_delete_event": self._delete_event,
"on_migrate_cancel_clicked": self._cancel_clicked,
"on_migrate_finish_clicked": self._finish_clicked,
"on_migrate_dest_changed" : self._destconn_changed,
"on_migrate_set_address_toggled" : self._set_address_toggled,
"on_migrate_set_port_toggled" : self._set_port_toggled,
"on_migrate_mode_changed" : self._mode_changed,
"on_migrate_dest_changed": self._destconn_changed,
"on_migrate_set_address_toggled": self._set_address_toggled,
"on_migrate_set_port_toggled": self._set_port_toggled,
"on_migrate_mode_changed": self._mode_changed,
})
self.bind_escape_key_close()

View File

@ -60,7 +60,7 @@ class vmmPreferences(vmmGObjectUI):
"on_vmm_preferences_delete_event": self.close,
"on_prefs_close_clicked": self.close,
"on_prefs_system_tray_toggled" : self.change_view_system_tray,
"on_prefs_system_tray_toggled": self.change_view_system_tray,
"on_prefs_stats_update_interval_changed": self.change_update_interval,
"on_prefs_console_accels_toggled": self.change_console_accels,
"on_prefs_console_scaling_changed": self.change_console_scaling,

View File

@ -85,8 +85,8 @@ class vmmSnapshotPage(vmmGObjectUI):
# 'Create' dialog
"on_snapshot_new_delete_event": self._snapshot_new_close,
"on_snapshot_new_ok_clicked": self._on_new_ok_clicked,
"on_snapshot_new_cancel_clicked" : self._snapshot_new_close,
"on_snapshot_new_name_changed" : self._snapshot_new_name_changed,
"on_snapshot_new_cancel_clicked": self._snapshot_new_close,
"on_snapshot_new_name_changed": self._snapshot_new_name_changed,
"on_snapshot_new_name_activate": self._on_new_ok_clicked,
})

View File

@ -44,7 +44,7 @@ class vmmStorageBrowser(vmmGObjectUI):
self._init_ui()
self.builder.connect_signals({
"on_vmm_storage_browse_delete_event" : self.close,
"on_vmm_storage_browse_delete_event": self.close,
})
self.bind_escape_key_close()

View File

@ -93,7 +93,7 @@ class vmmStorageList(vmmGObjectUI):
self.top_box = self.widget("storage-grid")
self.builder.connect_signals({
"on_pool_add_clicked" : self._pool_add,
"on_pool_add_clicked": self._pool_add,
"on_pool_stop_clicked": self._pool_stop,
"on_pool_start_clicked": self._pool_start,
"on_pool_delete_clicked": self._pool_delete,
@ -103,12 +103,12 @@ class vmmStorageList(vmmGObjectUI):
"on_vol_delete_clicked": self._vol_delete,
"on_vol_list_button_press_event": self._vol_popup_menu,
"on_vol_list_changed": self._vol_selected,
"on_vol_add_clicked" : self._vol_add,
"on_vol_add_clicked": self._vol_add,
"on_browse_cancel_clicked" : self._cancel_clicked,
"on_browse_local_clicked" : self._browse_local_clicked,
"on_choose_volume_clicked" : self._choose_volume_clicked,
"on_vol_list_row_activated" : self._vol_list_row_activated,
"on_browse_cancel_clicked": self._cancel_clicked,
"on_browse_local_clicked": self._browse_local_clicked,
"on_choose_volume_clicked": self._choose_volume_clicked,
"on_vol_list_row_activated": self._vol_list_row_activated,
"on_pool_name_changed": (lambda *x:
self._enable_pool_apply(x, EDIT_POOL_NAME)),

View File

@ -393,7 +393,7 @@ class Capabilities(XMLBuilder):
osstr = _("any virtualization options")
raise ValueError(_("Host does not support %(virttype)s %(arch)s") %
{'virttype' : osstr, 'arch' : archstr})
{'virttype': osstr, 'arch': archstr})
domain = guest.bestDomainType(dtype=typ, machine=machine)
if domain is None:

View File

@ -1063,7 +1063,7 @@ class VirtCLIParser(object):
@remove_first: List of parameters to peel off the front of the
option string, and store in the optdict. So:
remove_first=["char_type"] for --serial pty,foo=bar
maps to {"char_type", "pty", "foo" : "bar"}
maps to {"char_type", "pty", "foo": "bar"}
@stub_none: If the parsed option string is just 'none', make it a no-op.
This helps us be backwards compatible: for example, --rng none is
a no-op, but one day we decide to add an rng device by default to
@ -2544,9 +2544,9 @@ class _ParserChar(VirtCLIParser):
if not inst.supports_property(virtarg.attrname):
raise ValueError(_("%(devtype)s type '%(chartype)s' does not "
"support '%(optname)s' option.") %
{"devtype" : inst.virtual_device_type,
{"devtype": inst.virtual_device_type,
"chartype": inst.type,
"optname" : virtarg.cliname})
"optname": virtarg.cliname})
support_cb = support_check
def set_host_cb(self, inst, val, virtarg):

View File

@ -404,8 +404,8 @@ class Cloner(object):
if len(self.clone_disks) < len(self.original_disks):
raise ValueError(_("More disks to clone than new paths specified. "
"(%(passed)d specified, %(need)d needed") %
{"passed" : len(self.clone_disks),
"need" : len(self.original_disks)})
{"passed": len(self.clone_disks),
"need": len(self.original_disks)})
logging.debug("Clone paths: %s", [d.path for d in self.clone_disks])

View File

@ -141,17 +141,17 @@ class _VirtualCharDevice(VirtualDevice):
Whether the character dev type supports the passed property name
"""
users = {
"source_path" : [self.TYPE_FILE, self.TYPE_UNIX,
self.TYPE_DEV, self.TYPE_PIPE],
"source_mode" : [self.TYPE_UNIX, self.TYPE_TCP],
"source_host" : [self.TYPE_TCP, self.TYPE_UDP],
"source_port" : [self.TYPE_TCP, self.TYPE_UDP],
"source_channel": [self.TYPE_SPICEPORT],
"source_master" : [self.TYPE_NMDM],
"source_slave" : [self.TYPE_NMDM],
"protocol" : [self.TYPE_TCP],
"bind_host" : [self.TYPE_UDP],
"bind_port" : [self.TYPE_UDP],
"source_path": [self.TYPE_FILE, self.TYPE_UNIX,
self.TYPE_DEV, self.TYPE_PIPE],
"source_mode": [self.TYPE_UNIX, self.TYPE_TCP],
"source_host": [self.TYPE_TCP, self.TYPE_UDP],
"source_port": [self.TYPE_TCP, self.TYPE_UDP],
"source_channel": [self.TYPE_SPICEPORT],
"source_master": [self.TYPE_NMDM],
"source_slave": [self.TYPE_NMDM],
"protocol": [self.TYPE_TCP],
"bind_host": [self.TYPE_UDP],
"bind_port": [self.TYPE_UDP],
}
if ro:

View File

@ -40,14 +40,14 @@ class VirtualController(VirtualDevice):
@staticmethod
def pretty_type(ctype):
pretty_mappings = {
VirtualController.TYPE_IDE : "IDE",
VirtualController.TYPE_FDC : _("Floppy"),
VirtualController.TYPE_SCSI : "SCSI",
VirtualController.TYPE_SATA : "SATA",
VirtualController.TYPE_VIRTIOSERIAL : "VirtIO Serial",
VirtualController.TYPE_USB : "USB",
VirtualController.TYPE_PCI : "PCI",
VirtualController.TYPE_CCID : "CCID",
VirtualController.TYPE_IDE: "IDE",
VirtualController.TYPE_FDC: _("Floppy"),
VirtualController.TYPE_SCSI: "SCSI",
VirtualController.TYPE_SATA: "SATA",
VirtualController.TYPE_VIRTIOSERIAL: "VirtIO Serial",
VirtualController.TYPE_USB: "USB",
VirtualController.TYPE_PCI: "PCI",
VirtualController.TYPE_CCID: "CCID",
}
if ctype not in pretty_mappings:

View File

@ -47,12 +47,12 @@ class VirtualRNGDevice(VirtualDevice):
@staticmethod
def get_pretty_backend_type(backend_type):
return {"udp" : "UDP",
return {"udp": "UDP",
"tcp": "TCP"}.get(backend_type) or backend_type
@staticmethod
def get_pretty_mode(mode):
return {"bind" : _("Bind"),
return {"bind": _("Bind"),
"connect": _("Connect")}.get(mode) or mode
def supports_property(self, propname):
@ -60,16 +60,16 @@ class VirtualRNGDevice(VirtualDevice):
Whether the rng dev type supports the passed property name
"""
users = {
"type" : [self.TYPE_EGD, self.TYPE_RANDOM],
"model" : [self.TYPE_EGD, self.TYPE_RANDOM],
"bind_host" : [self.TYPE_EGD],
"bind_service" : [self.TYPE_EGD],
"connect_host" : [self.TYPE_EGD],
"connect_service" : [self.TYPE_EGD],
"backend_type" : [self.TYPE_EGD],
"device" : [self.TYPE_RANDOM],
"rate_bytes" : [self.TYPE_EGD, self.TYPE_RANDOM],
"rate_period" : [self.TYPE_EGD, self.TYPE_RANDOM],
"type": [self.TYPE_EGD, self.TYPE_RANDOM],
"model": [self.TYPE_EGD, self.TYPE_RANDOM],
"bind_host": [self.TYPE_EGD],
"bind_service": [self.TYPE_EGD],
"connect_host": [self.TYPE_EGD],
"connect_service": [self.TYPE_EGD],
"backend_type": [self.TYPE_EGD],
"device": [self.TYPE_RANDOM],
"rate_bytes": [self.TYPE_EGD, self.TYPE_RANDOM],
"rate_period": [self.TYPE_EGD, self.TYPE_RANDOM],
}
if users.get(propname):
return self.type in users[propname]

View File

@ -48,7 +48,7 @@ class VirtualTPMDevice(VirtualDevice):
Whether the TPM dev type supports the passed property name
"""
users = {
"device_path" : [self.TYPE_PASSTHROUGH],
"device_path": [self.TYPE_PASSTHROUGH],
}
if users.get(propname):

View File

@ -130,7 +130,7 @@ def check_if_path_managed(conn, path):
if not vol and not pool and verr:
raise ValueError(_("Cannot use storage %(path)s: %(err)s") %
{'path' : path, 'err' : verr})
{'path': path, 'err': verr})
return vol, pool
@ -407,7 +407,7 @@ class CloneStorageCreator(_StorageCreator):
def create(self, progresscb):
text = (_("Cloning %(srcfile)s") %
{'srcfile' : os.path.basename(self._input_path)})
{'srcfile': os.path.basename(self._input_path)})
size_bytes = (long(self.get_size()) *
long(1024) * long(1024) * long(1024))

View File

@ -173,7 +173,7 @@ class Network(XMLBuilder):
else:
if dev:
desc = (_("%(mode)s to %(device)s") %
{"mode" : mode, "device" : dev})
{"mode": mode, "device": dev})
else:
desc = _("%s network") % mode.capitalize()
else:

View File

@ -137,48 +137,48 @@ class _OSDB(object):
# This is only for back compatibility with pre-libosinfo support.
# This should never change.
_aliases = {
"altlinux" : "altlinux1.0",
"debianetch" : "debian4",
"debianlenny" : "debian5",
"debiansqueeze" : "debian6",
"debianwheezy" : "debian7",
"freebsd10" : "freebsd10.0",
"freebsd6" : "freebsd6.0",
"freebsd7" : "freebsd7.0",
"freebsd8" : "freebsd8.0",
"freebsd9" : "freebsd9.0",
"mandriva2009" : "mandriva2009.0",
"mandriva2010" : "mandriva2010.0",
"mbs1" : "mbs1.0",
"msdos" : "msdos6.22",
"openbsd4" : "openbsd4.2",
"opensolaris" : "opensolaris2009.06",
"opensuse11" : "opensuse11.4",
"opensuse12" : "opensuse12.3",
"rhel4" : "rhel4.0",
"rhel5" : "rhel5.0",
"rhel6" : "rhel6.0",
"rhel7" : "rhel7.0",
"ubuntuhardy" : "ubuntu8.04",
"ubuntuintrepid" : "ubuntu8.10",
"ubuntujaunty" : "ubuntu9.04",
"ubuntukarmic" : "ubuntu9.10",
"ubuntulucid" : "ubuntu10.04",
"ubuntumaverick" : "ubuntu10.10",
"ubuntunatty" : "ubuntu11.04",
"ubuntuoneiric" : "ubuntu11.10",
"ubuntuprecise" : "ubuntu12.04",
"ubuntuquantal" : "ubuntu12.10",
"ubunturaring" : "ubuntu13.04",
"ubuntusaucy" : "ubuntu13.10",
"altlinux": "altlinux1.0",
"debianetch": "debian4",
"debianlenny": "debian5",
"debiansqueeze": "debian6",
"debianwheezy": "debian7",
"freebsd10": "freebsd10.0",
"freebsd6": "freebsd6.0",
"freebsd7": "freebsd7.0",
"freebsd8": "freebsd8.0",
"freebsd9": "freebsd9.0",
"mandriva2009": "mandriva2009.0",
"mandriva2010": "mandriva2010.0",
"mbs1": "mbs1.0",
"msdos": "msdos6.22",
"openbsd4": "openbsd4.2",
"opensolaris": "opensolaris2009.06",
"opensuse11": "opensuse11.4",
"opensuse12": "opensuse12.3",
"rhel4": "rhel4.0",
"rhel5": "rhel5.0",
"rhel6": "rhel6.0",
"rhel7": "rhel7.0",
"ubuntuhardy": "ubuntu8.04",
"ubuntuintrepid": "ubuntu8.10",
"ubuntujaunty": "ubuntu9.04",
"ubuntukarmic": "ubuntu9.10",
"ubuntulucid": "ubuntu10.04",
"ubuntumaverick": "ubuntu10.10",
"ubuntunatty": "ubuntu11.04",
"ubuntuoneiric": "ubuntu11.10",
"ubuntuprecise": "ubuntu12.04",
"ubuntuquantal": "ubuntu12.10",
"ubunturaring": "ubuntu13.04",
"ubuntusaucy": "ubuntu13.10",
"virtio26": "fedora10",
"vista" : "winvista",
"winxp64" : "winxp",
"vista": "winvista",
"winxp64": "winxp",
# Old --os-type values
"linux" : "generic",
"windows" : "winxp",
"solaris" : "solaris10",
"linux": "generic",
"windows": "winxp",
"solaris": "solaris10",
"unix": "freebsd9.0",
"other": "generic",
}
@ -384,9 +384,9 @@ class _OsVariant(object):
return None
urldistro = self.distro
remap = {
"opensuse" : "suse",
"sles" : "suse",
"mes" : "mandriva"
"opensuse": "suse",
"sles": "suse",
"mes": "mandriva"
}
if remap.get(urldistro):

View File

@ -455,7 +455,7 @@ class StoragePool(_StorageObject):
self.TYPE_RBD, self.TYPE_SHEEPDOG],
"format": [self.TYPE_FS, self.TYPE_NETFS, self.TYPE_DISK],
"iqn": [self.TYPE_ISCSI],
"target_path" : [self.TYPE_DIR, self.TYPE_FS, self.TYPE_NETFS,
"target_path": [self.TYPE_DIR, self.TYPE_FS, self.TYPE_NETFS,
self.TYPE_LOGICAL, self.TYPE_DISK, self.TYPE_ISCSI,
self.TYPE_SCSI, self.TYPE_MPATH]
}

View File

@ -593,7 +593,7 @@ class Distro(object):
if not kernelpath or not initrdpath:
raise RuntimeError(_("Couldn't find %(type)s kernel for "
"%(distro)s tree.") %
{"distro": self.name, "type" : self.type})
{"distro": self.name, "type": self.type})
return self._kernelFetchHelper(guest, kernelpath, initrdpath)