virt-manager/virtman-python2-to-python3-conversion.patch
Charles Arnold a962c4a1c4 - Upstream bug fixes (bsc#1027942)
b5b2433a-baseclass-Fix-UI-file-loading-on-py3.patch
  0c6bcb09-fix-bytes-string-mess-in-serial-console.patch
  bc8c5b07-append--attach-to-virt-viewer-if-graphics-has-listen-type-none.patch
  0e812e3c-dont-skip-authentication-for-listen-type-none-with-fixed-QEMU.patch
  67122615-python2to3-division-compatability.patch
- Dropped in favor of upstream version
  0001-virtinst-python3-terminal-width-should-be-int.patch
  python3-fix-bytes-string-mess-in-serial-console.patch

- Default to sles15 and opensuse15 as the 'preferred_distros' for
  this release. (bsc#1054986)
  virtinst-osdict-get_supported.patch
  virt-manager.spec
  (bsc#1070896)

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=405
2018-02-06 20:28:37 +00:00

821 lines
30 KiB
Diff

Index: virt-manager-1.4.3/virt-manager
===================================================================
--- virt-manager-1.4.3.orig/virt-manager
+++ virt-manager-1.4.3/virt-manager
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/python3
#
# Copyright (C) 2006, 2014 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
@@ -81,7 +81,7 @@ def _import_gtk(leftovers):
print("gtk3 3.14.0 or later is required.")
sys.exit(1)
- if os.environ.has_key('DISPLAY') and os.environ['DISPLAY']:
+ if 'DISPLAY' in os.environ and os.environ['DISPLAY']:
# This will error if Gtk wasn't correctly initialized
Gtk.Window()
else:
Index: virt-manager-1.4.3/virtManager/network.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/network.py
+++ virt-manager-1.4.3/virtManager/network.py
@@ -103,7 +103,7 @@ class vmmNetwork(vmmLibvirtObject):
def set_qos(self, **kwargs):
xmlobj = self._make_xmlobj_to_define()
q = xmlobj.bandwidth
- for key, val in kwargs.items():
+ for key, val in list(kwargs.items()):
setattr(q, key, val)
self._redefine_xmlobj(xmlobj)
Index: virt-manager-1.4.3/virtManager/inspection.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/inspection.py
+++ virt-manager-1.4.3/virtManager/inspection.py
@@ -17,8 +17,9 @@
# MA 02110-1301 USA.
#
-from Queue import Queue
+from queue import Queue
from threading import Thread
+import functools
import logging
from guestfs import GuestFS # pylint: disable=import-error
@@ -212,7 +213,7 @@ class vmmInspection(vmmGObject):
return 0
else:
return -1
- mps.sort(compare)
+ mps.sort(key=functools.cmp_to_key(compare))
for mp_dev in mps:
try:
@@ -263,7 +264,7 @@ class vmmInspection(vmmGObject):
data.product_name = str(product_name)
data.product_variant = str(product_variant)
data.icon = icon
- data.applications = list(apps)
+ data.applications = apps if apps is None else list(apps)
data.error = False
return data
Index: virt-manager-1.4.3/virtManager/systray.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/systray.py
+++ virt-manager-1.4.3/virtManager/systray.py
@@ -199,13 +199,13 @@ class vmmSystray(vmmGObject):
def repopulate_menu_list(self):
# Build sorted connection list
- connsort = self.conn_menuitems.keys()
+ connsort = list(self.conn_menuitems.keys())
connsort.sort()
connsort.reverse()
# Empty conn list
for child in self.systray_menu.get_children():
- if child in self.conn_menuitems.values():
+ if child in list(self.conn_menuitems.values()):
self.systray_menu.remove(child)
# Build sorted conn list
@@ -265,7 +265,7 @@ class vmmSystray(vmmGObject):
for vm in conn.list_vms():
vm_mappings[vm.get_name()] = vm.get_connkey()
- vm_names = vm_mappings.keys()
+ vm_names = list(vm_mappings.keys())
vm_names.sort()
if len(vm_names) == 0:
Index: virt-manager-1.4.3/virtManager/console.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/console.py
+++ virt-manager-1.4.3/virtManager/console.py
@@ -35,7 +35,7 @@ from .viewers import SpiceViewer, VNCVie
(_CONSOLE_PAGE_UNAVAILABLE,
_CONSOLE_PAGE_AUTHENTICATE,
_CONSOLE_PAGE_SERIAL,
- _CONSOLE_PAGE_VIEWER) = range(4)
+ _CONSOLE_PAGE_VIEWER) = list(range(4))
class _TimedRevealer(vmmGObject):
Index: virt-manager-1.4.3/virtManager/connection.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/connection.py
+++ virt-manager-1.4.3/virtManager/connection.py
@@ -198,7 +198,7 @@ class vmmConnection(vmmGObject):
(_STATE_DISCONNECTED,
_STATE_CONNECTING,
- _STATE_ACTIVE) = range(1, 4)
+ _STATE_ACTIVE) = list(range(1, 4))
def __init__(self, uri):
vmmGObject.__init__(self)
@@ -1215,35 +1215,35 @@ class vmmConnection(vmmGObject):
def _update_nets(self, dopoll):
keymap = dict((o.get_connkey(), o) for o in self.list_nets())
if not dopoll or not self.is_network_capable():
- return [], [], keymap.values()
+ return [], [], list(keymap.values())
return pollhelpers.fetch_nets(self._backend, keymap,
(lambda obj, key: vmmNetwork(self, obj, key)))
def _update_pools(self, dopoll):
keymap = dict((o.get_connkey(), o) for o in self.list_pools())
if not dopoll or not self.is_storage_capable():
- return [], [], keymap.values()
+ return [], [], list(keymap.values())
return pollhelpers.fetch_pools(self._backend, keymap,
(lambda obj, key: vmmStoragePool(self, obj, key)))
def _update_interfaces(self, dopoll):
keymap = dict((o.get_connkey(), o) for o in self.list_interfaces())
if not dopoll or not self.is_interface_capable():
- return [], [], keymap.values()
+ return [], [], list(keymap.values())
return pollhelpers.fetch_interfaces(self._backend, keymap,
(lambda obj, key: vmmInterface(self, obj, key)))
def _update_nodedevs(self, dopoll):
keymap = dict((o.get_connkey(), o) for o in self.list_nodedevs())
if not dopoll or not self.is_nodedev_capable():
- return [], [], keymap.values()
+ return [], [], list(keymap.values())
return pollhelpers.fetch_nodedevs(self._backend, keymap,
(lambda obj, key: vmmNodeDevice(self, obj, key)))
def _update_vms(self, dopoll):
keymap = dict((o.get_connkey(), o) for o in self.list_vms())
if not dopoll:
- return [], [], keymap.values()
+ return [], [], list(keymap.values())
return pollhelpers.fetch_vms(self._backend, keymap,
(lambda obj, key: vmmDomain(self, obj, key)))
Index: virt-manager-1.4.3/virtManager/addhardware.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/addhardware.py
+++ virt-manager-1.4.3/virtManager/addhardware.py
@@ -57,7 +57,7 @@ from .addstorage import vmmAddStorage
PAGE_USBREDIR,
PAGE_TPM,
PAGE_RNG,
- PAGE_PANIC) = range(0, 17)
+ PAGE_PANIC) = list(range(0, 17))
class vmmAddHardware(vmmGObjectUI):
@@ -1160,7 +1160,7 @@ class vmmAddHardware(vmmGObjectUI):
self._dev = VirtualTPMDevice(self.conn.get_backend())
self._dev.type = devtype
- for param_name, widget_name in tpm_widget_mappings.items():
+ for param_name, widget_name in list(tpm_widget_mappings.items()):
make_visible = self._dev.supports_property(param_name)
uiutil.set_grid_row_visible(self.widget(widget_name + "-label"),
make_visible)
@@ -1214,7 +1214,7 @@ class vmmAddHardware(vmmGObjectUI):
self._dev = char_class(self.conn.get_backend())
self._dev.type = devtype
- for param_name, widget_name in char_widget_mappings.items():
+ for param_name, widget_name in list(char_widget_mappings.items()):
make_visible = self._dev.supports_property(param_name)
uiutil.set_grid_row_visible(self.widget(widget_name + "-label"),
make_visible)
@@ -1669,7 +1669,7 @@ class vmmAddHardware(vmmGObjectUI):
try:
self._dev = devclass
- for param_name, val in value_mappings.items():
+ for param_name, val in list(value_mappings.items()):
if self._dev.supports_property(param_name) and val is not None:
setattr(self._dev, param_name, val)
@@ -1750,7 +1750,7 @@ class vmmAddHardware(vmmGObjectUI):
try:
self._dev = VirtualTPMDevice(conn)
self._dev.type = typ
- for param_name, val in value_mappings.items():
+ for param_name, val in list(value_mappings.items()):
if self._dev.supports_property(param_name):
setattr(self._dev, param_name, val)
except Exception as e:
@@ -1854,7 +1854,7 @@ class vmmAddHardware(vmmGObjectUI):
try:
self._dev = virtinst.VirtualRNGDevice(self.conn.get_backend())
self._dev.type = rtype
- for param_name, val in value_mappings.items():
+ for param_name, val in list(value_mappings.items()):
if self._dev.supports_property(param_name):
setattr(self._dev, param_name, val)
except Exception as e:
Index: virt-manager-1.4.3/virtManager/createinterface.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/createinterface.py
+++ virt-manager-1.4.3/virtManager/createinterface.py
@@ -387,7 +387,7 @@ class vmmCreateInterface(vmmGObjectUI):
Interface.INTERFACE_TYPE_VLAN: "vlan",
}
- for key, value in type_dict.items():
+ for key, value in list(type_dict.items()):
do_show = (key == itype)
self.widget("%s-label" % value).set_visible(do_show)
self.widget("%s-box" % value).set_visible(do_show)
@@ -544,7 +544,7 @@ class vmmCreateInterface(vmmGObjectUI):
active, None, iface.get_mac()]
row_dict[name] = row
- for name, row in nodedevs.items():
+ for name, row in list(nodedevs.items()):
try:
key = Interface(self.conn.get_backend())
key.type = Interface.INTERFACE_TYPE_ETHERNET
@@ -556,12 +556,12 @@ class vmmCreateInterface(vmmGObjectUI):
row[INTERFACE_ROW_KEY] = key
row_dict[name] = row
- for row in row_dict.values():
+ for row in list(row_dict.values()):
name = row[INTERFACE_ROW_NAME]
row[INTERFACE_ROW_IN_USE_BY] = self.iface_in_use_by(self.conn,
name)
- for row in row_dict.values():
+ for row in list(row_dict.values()):
model.append(row)
def get_default_name(self):
Index: virt-manager-1.4.3/virtManager/snapshots.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/snapshots.py
+++ virt-manager-1.4.3/virtManager/snapshots.py
@@ -44,7 +44,7 @@ mimemap = {
def _mime_to_ext(val, reverse=False):
- for m, e in mimemap.items():
+ for m, e in list(mimemap.items()):
if val == m and not reverse:
return e
if val == e and reverse:
@@ -507,7 +507,7 @@ class vmmSnapshotPage(vmmGObjectUI):
basesn = os.path.join(cachedir, "snap-screenshot-%s" % name)
# Remove any pre-existing screenshots so we don't show stale data
- for ext in mimemap.values():
+ for ext in list(mimemap.values()):
p = basesn + "." + ext
if os.path.exists(basesn + "." + ext):
os.unlink(p)
Index: virt-manager-1.4.3/virtManager/graphwidgets.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/graphwidgets.py
+++ virt-manager-1.4.3/virtManager/graphwidgets.py
@@ -25,8 +25,8 @@ from gi.repository import Gtk
def rect_print(name, rect):
# For debugging
- print("%s: height=%d, width=%d, x=%d, y=%d" %
- (name, rect.height, rect.width, rect.x, rect.y))
+ print(("%s: height=%d, width=%d, x=%d, y=%d" %
+ (name, rect.height, rect.width, rect.x, rect.y)))
def _line_helper(cairo_ct, x, y, w, h, points, for_fill=False):
Index: virt-manager-1.4.3/virtManager/host.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/host.py
+++ virt-manager-1.4.3/virtManager/host.py
@@ -43,11 +43,11 @@ EDIT_NET_IDS = (
EDIT_NET_NAME,
EDIT_NET_AUTOSTART,
EDIT_NET_QOS,
-) = range(3)
+) = list(range(3))
EDIT_INTERFACE_IDS = (
EDIT_INTERFACE_STARTMODE,
-) = range(200, 201)
+) = list(range(200, 201))
class vmmHost(vmmGObjectUI):
Index: virt-manager-1.4.3/virtManager/sshtunnels.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/sshtunnels.py
+++ virt-manager-1.4.3/virtManager/sshtunnels.py
@@ -20,7 +20,7 @@
import functools
import logging
import os
-import Queue
+import queue
import socket
import signal
import threading
@@ -125,7 +125,7 @@ class _TunnelScheduler(object):
"""
def __init__(self):
self._thread = None
- self._queue = Queue.Queue()
+ self._queue = queue.Queue()
self._lock = threading.Lock()
def _handle_queue(self):
Index: virt-manager-1.4.3/virtManager/engine.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/engine.py
+++ virt-manager-1.4.3/virtManager/engine.py
@@ -20,7 +20,7 @@
import logging
import re
-import Queue
+import queue
import threading
import traceback
@@ -60,7 +60,7 @@ DETAILS_CONFIG = 2
DETAILS_CONSOLE = 3
(PRIO_HIGH,
- PRIO_LOW) = range(1, 3)
+ PRIO_LOW) = list(range(1, 3))
class vmmEngine(vmmGObject):
@@ -104,7 +104,7 @@ class vmmEngine(vmmGObject):
target=self._handle_tick_queue,
args=())
self._tick_thread.daemon = True
- self._tick_queue = Queue.PriorityQueue(100)
+ self._tick_queue = queue.PriorityQueue(100)
self.inspection = None
self._create_inspection_thread()
@@ -153,7 +153,7 @@ class vmmEngine(vmmGObject):
self._application.add_action(action)
def _default_startup(self, skip_autostart):
- uris = self.conns.keys()
+ uris = list(self.conns.keys())
if not uris:
logging.debug("No stored URIs found.")
else:
@@ -279,15 +279,15 @@ class vmmEngine(vmmGObject):
"""
We serialize conn autostart, so polkit/ssh-askpass doesn't spam
"""
- queue = Queue.Queue()
+ local_queue = queue.Queue()
auto_conns = [uri for uri in self.conns
if self.conns[uri]["conn"].get_autoconnect()]
def add_next_to_queue():
if not auto_conns:
- queue.put(None)
+ local_queue.put(None)
else:
- queue.put(auto_conns.pop(0))
+ local_queue.put(auto_conns.pop(0))
def state_change_cb(conn):
if conn.is_active():
@@ -299,7 +299,7 @@ class vmmEngine(vmmGObject):
def handle_queue():
while True:
- uri = queue.get()
+ uri = local_queue.get()
if uri is None:
return
if uri not in self.conns:
@@ -336,7 +336,7 @@ class vmmEngine(vmmGObject):
hvuri = conn.get_uri()
- for connkey in self.conns[hvuri]["windowDetails"].keys():
+ for connkey in list(self.conns[hvuri]["windowDetails"].keys()):
self.conns[hvuri]["windowDetails"][connkey].cleanup()
del(self.conns[hvuri]["windowDetails"][connkey])
@@ -521,10 +521,10 @@ class vmmEngine(vmmGObject):
focus, and use that
"""
windowlist = [self.windowManager]
- for conndict in self.conns.values():
- windowlist.extend(conndict["windowDetails"].values())
+ for conndict in list(self.conns.values()):
+ windowlist.extend(list(conndict["windowDetails"].values()))
windowlist.extend(
- [conndict["windowHost"] for conndict in self.conns.values()])
+ [conndict["windowHost"] for conndict in list(self.conns.values())])
use_win = None
for window in windowlist:
@@ -600,7 +600,7 @@ class vmmEngine(vmmGObject):
self.conns[uri]["windowClone"].cleanup()
details = self.conns[uri]["windowDetails"]
- for win in details.values():
+ for win in list(details.values()):
win.cleanup()
self.conns[uri]["conn"].cleanup()
@@ -620,7 +620,7 @@ class vmmEngine(vmmGObject):
handle_id = vmmGObject.connect(self, name, callback, *args)
if name == "conn-added":
- for conn_dict in self.conns.values():
+ for conn_dict in list(self.conns.values()):
self.emit("conn-added", conn_dict["conn"])
return handle_id
@@ -770,7 +770,7 @@ class vmmEngine(vmmGObject):
return self.connect_to_uri(uri, autoconnect, probe=True)
def cancelled(src):
- if len(self.conns.keys()) == 0:
+ if len(list(self.conns.keys())) == 0:
self.exit_app(src)
obj = vmmConnect()
Index: virt-manager-1.4.3/virtManager/mediacombo.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/mediacombo.py
+++ virt-manager-1.4.3/virtManager/mediacombo.py
@@ -33,7 +33,7 @@ class vmmMediaCombo(vmmGObjectUI):
(OPTICAL_DEV_PATH,
OPTICAL_LABEL,
OPTICAL_HAS_MEDIA,
- OPTICAL_DEV_KEY) = range(OPTICAL_FIELDS)
+ OPTICAL_DEV_KEY) = list(range(OPTICAL_FIELDS))
def __init__(self, conn, builder, topwin, media_type):
vmmGObjectUI.__init__(self, None, None, builder=builder, topwin=topwin)
Index: virt-manager-1.4.3/virtManager/clone.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/clone.py
+++ virt-manager-1.4.3/virtManager/clone.py
@@ -336,7 +336,7 @@ class vmmCloneVM(vmmGObjectUI):
build_net_row(label, mac, newmac)
- no_net = bool(len(self.net_list.keys()) == 0)
+ no_net = bool(len(list(self.net_list.keys())) == 0)
self.widget("clone-network-box").set_visible(not no_net)
self.widget("clone-no-net").set_visible(no_net)
@@ -460,7 +460,7 @@ class vmmCloneVM(vmmGObjectUI):
if cd.clone_name == newname:
return
- for row in self.storage_list.values():
+ for row in list(self.storage_list.values()):
origpath = row[STORAGE_INFO_ORIG_PATH]
if row[STORAGE_INFO_MANUAL_PATH]:
continue
@@ -599,7 +599,7 @@ class vmmCloneVM(vmmGObjectUI):
# If any storage cannot be cloned or shared, don't allow cloning
clone = True
tooltip = ""
- for row in self.storage_list.values():
+ for row in list(self.storage_list.values()):
can_clone = row[STORAGE_INFO_CAN_CLONE]
can_share = row[STORAGE_INFO_CAN_SHARE]
if not (can_clone or can_share):
Index: virt-manager-1.4.3/virtManager/netlist.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/netlist.py
+++ virt-manager-1.4.3/virtManager/netlist.py
@@ -197,7 +197,7 @@ class vmmNetworkList(vmmGObjectUI):
for slave in slave_names:
netdevs.pop(slave, None)
- for name, is_bridge, slave_names in netdevs.values():
+ for name, is_bridge, slave_names in list(netdevs.values()):
if ((name in vnet_taps) or
(name in [v + "-nic" for v in vnet_bridges]) or
(name in skip_ifaces)):
Index: virt-manager-1.4.3/virtManager/manager.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/manager.py
+++ virt-manager-1.4.3/virtManager/manager.py
@@ -48,7 +48,7 @@ ROW_IS_CONN_CONNECTED,
ROW_IS_VM,
ROW_IS_VM_RUNNING,
ROW_COLOR,
-ROW_INSPECTION_OS_ICON) = range(11)
+ROW_INSPECTION_OS_ICON) = list(range(11))
# Columns in the tree view
(COL_NAME,
@@ -56,7 +56,7 @@ COL_GUEST_CPU,
COL_HOST_CPU,
COL_MEM,
COL_DISK,
-COL_NETWORK) = range(6)
+COL_NETWORK) = list(range(6))
def _style_get_prop(widget, propname):
Index: virt-manager-1.4.3/virtManager/keyring.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/keyring.py
+++ virt-manager-1.4.3/virtManager/keyring.py
@@ -110,10 +110,10 @@ class vmmKeyring(object):
label = iface.get_cached_property("Label").unpack().strip("'")
dbusattrs = iface.get_cached_property("Attributes").unpack()
- secret = u"".join([unichr(c) for c in secretbytes])
+ secret = "".join([chr(c) for c in secretbytes])
attrs = {}
- for key, val in dbusattrs.items():
+ for key, val in list(dbusattrs.items()):
if key not in ["hvuri", "uuid"]:
continue
attrs["%s" % key] = "%s" % val
Index: virt-manager-1.4.3/virtManager/addstorage.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/addstorage.py
+++ virt-manager-1.4.3/virtManager/addstorage.py
@@ -162,7 +162,7 @@ class vmmAddStorage(vmmGObjectUI):
errmsg = _("Errors were encountered changing permissions for the "
"following directories:")
details = ""
- for p, error in errors.items():
+ for p, error in list(errors.items()):
if p not in broken_paths:
continue
details += "%s : %s\n" % (p, error)
@@ -174,7 +174,7 @@ class vmmAddStorage(vmmGObjectUI):
_("Don't ask about these directories again."))
if chkres:
- src.config.add_perms_fix_ignore(errors.keys())
+ src.config.add_perms_fix_ignore(list(errors.keys()))
def reset_state(self):
self._update_host_space()
Index: virt-manager-1.4.3/virtManager/details.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/details.py
+++ virt-manager-1.4.3/virtManager/details.py
@@ -106,7 +106,7 @@ from .graphwidgets import Sparkline
EDIT_FS,
- EDIT_HOSTDEV_ROMBAR) = range(1, 49)
+ EDIT_HOSTDEV_ROMBAR) = list(range(1, 49))
# Columns in hw list model
@@ -114,7 +114,7 @@ from .graphwidgets import Sparkline
HW_LIST_COL_ICON_NAME,
HW_LIST_COL_ICON_SIZE,
HW_LIST_COL_TYPE,
- HW_LIST_COL_DEVICE) = range(5)
+ HW_LIST_COL_DEVICE) = list(range(5))
# Types for the hw list model: numbers specify what order they will be listed
(HW_LIST_TYPE_GENERAL,
@@ -138,7 +138,7 @@ from .graphwidgets import Sparkline
HW_LIST_TYPE_REDIRDEV,
HW_LIST_TYPE_TPM,
HW_LIST_TYPE_RNG,
- HW_LIST_TYPE_PANIC) = range(22)
+ HW_LIST_TYPE_PANIC) = list(range(22))
remove_pages = [HW_LIST_TYPE_NIC, HW_LIST_TYPE_INPUT,
HW_LIST_TYPE_GRAPHICS, HW_LIST_TYPE_SOUND, HW_LIST_TYPE_CHAR,
@@ -153,12 +153,12 @@ remove_pages = [HW_LIST_TYPE_NIC, HW_LIS
BOOT_LABEL,
BOOT_ICON,
BOOT_ACTIVE,
- BOOT_CAN_SELECT) = range(5)
+ BOOT_CAN_SELECT) = list(range(5))
# Main tab pages
(DETAILS_PAGE_DETAILS,
DETAILS_PAGE_CONSOLE,
- DETAILS_PAGE_SNAPSHOTS) = range(3)
+ DETAILS_PAGE_SNAPSHOTS) = list(range(3))
_remove_tooltip = _("Remove this device from the virtual machine")
@@ -744,7 +744,7 @@ class vmmDetails(vmmGObjectUI):
rmHW.connect("activate", self.remove_xml_dev)
self._addhwmenuitems = {"add": addHW, "remove": rmHW}
- for i in self._addhwmenuitems.values():
+ for i in list(self._addhwmenuitems.values()):
self.addhwmenu.add(i)
self.widget("hw-panel").set_show_tabs(False)
@@ -1519,7 +1519,7 @@ class vmmDetails(vmmGObjectUI):
'tEXt::Generator Version': self.config.get_appversion(),
}
- ret = image.save_to_bufferv('png', metadata.keys(), metadata.values())
+ ret = image.save_to_bufferv('png', list(metadata.keys()), list(metadata.values()))
# On Fedora 19, ret is (bool, str)
# Someday the bindings might be fixed to just return the str, try
# and future proof it a bit
@@ -2835,7 +2835,7 @@ class vmmDetails(vmmGObjectUI):
set_visible("rng-bind-host", is_egd and (udp or bind))
set_visible("rng-bind-service", is_egd and (udp or bind))
- for k, prop in values.items():
+ for k, prop in list(values.items()):
val = "-"
if dev.supports_property(prop):
val = getattr(dev, prop) or "-"
@@ -3214,7 +3214,7 @@ class vmmDetails(vmmGObjectUI):
for dev in self.vm.get_panic_devices():
update_hwlist(HW_LIST_TYPE_PANIC, dev)
- devs = range(len(hw_list_model))
+ devs = list(range(len(hw_list_model)))
devs.reverse()
for i in devs:
_iter = hw_list_model.iter_nth_child(None, i)
Index: virt-manager-1.4.3/virtManager/create.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/create.py
+++ virt-manager-1.4.3/virtManager/create.py
@@ -55,7 +55,7 @@ DEFAULT_MEM = 1024
PAGE_INSTALL,
PAGE_MEM,
PAGE_STORAGE,
- PAGE_FINISH) = range(5)
+ PAGE_FINISH) = list(range(5))
(INSTALL_PAGE_ISO,
INSTALL_PAGE_URL,
@@ -63,13 +63,13 @@ DEFAULT_MEM = 1024
INSTALL_PAGE_IMPORT,
INSTALL_PAGE_CONTAINER_APP,
INSTALL_PAGE_CONTAINER_OS,
- INSTALL_PAGE_VZ_TEMPLATE) = range(7)
+ INSTALL_PAGE_VZ_TEMPLATE) = list(range(7))
# Column numbers for os type/version list models
(OS_COL_ID,
OS_COL_LABEL,
OS_COL_IS_SEP,
- OS_COL_IS_SHOW_ALL) = range(4)
+ OS_COL_IS_SHOW_ALL) = list(range(4))
#####################
@@ -951,7 +951,7 @@ class vmmCreate(vmmGObjectUI):
model.clear()
default = -1
- for c in self.engine.conns.values():
+ for c in list(self.engine.conns.values()):
connobj = c["conn"]
if not connobj.is_active():
continue
@@ -2579,7 +2579,7 @@ class vmmCreate(vmmGObjectUI):
'passwd': self._get_config_oscontainer_source_password,
'insecure': self._get_config_oscontainer_isecure
}
- for key, getter in bootstrap_arg_keys.items():
+ for key, getter in list(bootstrap_arg_keys.items()):
bootstrap_args[key] = getter()
parentobj = self._customize_window or self
Index: virt-manager-1.4.3/virtManager/preferences.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/preferences.py
+++ virt-manager-1.4.3/virtManager/preferences.py
@@ -121,7 +121,7 @@ class vmmPreferences(vmmGObjectUI):
}
model.append([-1, _("System default (%s)") %
vals[self.config.default_console_resizeguest]])
- for key, val in vals.items():
+ for key, val in list(vals.items()):
model.append([key, val])
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)
Index: virt-manager-1.4.3/virtManager/migrate.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/migrate.py
+++ virt-manager-1.4.3/virtManager/migrate.py
@@ -36,7 +36,7 @@ from .domain import vmmDomain
NUM_COLS = 3
(COL_LABEL,
COL_URI,
- COL_CAN_MIGRATE) = range(NUM_COLS)
+ COL_CAN_MIGRATE) = list(range(NUM_COLS))
class vmmMigrateDialog(vmmGObjectUI):
@@ -310,7 +310,7 @@ class vmmMigrateDialog(vmmGObjectUI):
model.clear()
rows = []
- for conn in self._conns.values():
+ for conn in list(self._conns.values()):
rows.append(self._build_dest_row(conn))
if not any([row[COL_CAN_MIGRATE] for row in rows]):
Index: virt-manager-1.4.3/virtManager/connect.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/connect.py
+++ virt-manager-1.4.3/virtManager/connect.py
@@ -22,7 +22,7 @@ import glob
import os
import logging
import socket
-import urllib
+import urllib.request, urllib.parse, urllib.error
from gi.repository import Gio
from gi.repository import GObject
@@ -36,11 +36,11 @@ HV_XEN,
HV_LXC,
HV_QEMU_SESSION,
HV_BHYVE,
-HV_VZ) = range(6)
+HV_VZ) = list(range(6))
(CONN_SSH,
CONN_TCP,
-CONN_TLS) = range(3)
+CONN_TLS) = list(range(3))
def current_user():
@@ -394,7 +394,7 @@ class vmmConnect(vmmGObjectUI):
addrstr = ""
if user:
- addrstr += urllib.quote(user) + "@"
+ addrstr += urllib.parse.quote(user) + "@"
if host.count(":") > 1:
host = "[%s]" % host
@@ -449,7 +449,7 @@ class vmmConnect(vmmGObjectUI):
if host.startswith("linux-"):
tmphost = host[6:]
try:
- long(tmphost)
+ int(tmphost)
host = ""
except ValueError:
pass
Index: virt-manager-1.4.3/virtManager/storagelist.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/storagelist.py
+++ virt-manager-1.4.3/virtManager/storagelist.py
@@ -36,7 +36,7 @@ from .createvol import vmmCreateVolume
EDIT_POOL_IDS = (
EDIT_POOL_NAME,
EDIT_POOL_AUTOSTART,
-) = range(2)
+) = list(range(2))
VOL_NUM_COLUMNS = 7
(VOL_COLUMN_KEY,
@@ -45,13 +45,13 @@ VOL_NUM_COLUMNS = 7
VOL_COLUMN_SIZESTR,
VOL_COLUMN_FORMAT,
VOL_COLUMN_INUSEBY,
- VOL_COLUMN_SENSITIVE) = range(VOL_NUM_COLUMNS)
+ VOL_COLUMN_SENSITIVE) = list(range(VOL_NUM_COLUMNS))
POOL_NUM_COLUMNS = 4
(POOL_COLUMN_CONNKEY,
POOL_COLUMN_LABEL,
POOL_COLUMN_ISACTIVE,
- POOL_COLUMN_PERCENT) = range(POOL_NUM_COLUMNS)
+ POOL_COLUMN_PERCENT) = list(range(POOL_NUM_COLUMNS))
ICON_RUNNING = "state_running"
ICON_SHUTOFF = "state_shutoff"
Index: virt-manager-1.4.3/virtManager/createnet.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/createnet.py
+++ virt-manager-1.4.3/virtManager/createnet.py
@@ -35,7 +35,7 @@ from .baseclass import vmmGObjectUI
(PAGE_NAME,
PAGE_IPV4,
PAGE_IPV6,
-PAGE_MISC) = range(4)
+PAGE_MISC) = list(range(4))
PAGE_MAX = PAGE_MISC