SHA256
1
0
forked from pool/libvirt
libvirt/6b3d716e-keycodemap-py3.patch
Cédric Bosdonnat 63dfdb29d7 Accepting request 574765 from home:cbosdonnat:branches:Virtualization
- Remove all uses of python2 during the build (bsc#1080034)
    6b3d716e-keycodemap-py3.patch
    apibuild-py3.patch
- Determine hostname early to avoid code injection
  in lxc driver. (bsc#1080042)
    759b4d1b-virlog-determine-the-hostname-on-startup-CVE-2018-67.patch
- Add basic support of connectGetAllDomainStats for lxc driver
  (fate#323742)
    0001-Extract-stats-functions-from-the-qemu-driver.patch
    0002-lxc-implement-connectGetAllDomainStats.patch

OBS-URL: https://build.opensuse.org/request/show/574765
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=667
2018-02-09 16:35:42 +00:00

95 lines
3.7 KiB
Diff

From 6b3d716e2b6472eb7189d3220552280ef3d832ce Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange@redhat.com>
Date: Fri, 12 Jan 2018 13:53:44 +0000
Subject: [PATCH] Fix compat with py3 dict keys/values data types
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
tools/keymap-gen | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/keymap-gen b/tools/keymap-gen
index d4594b4..f0269e3 100755
--- a/tools/keymap-gen
+++ b/tools/keymap-gen
@@ -356,19 +356,19 @@ class LanguageSrcGenerator(LanguageGenerator):
if frommapname in database.ENUM_COLUMNS:
fromtype = self.TYPE_ENUM
- elif type(tolinux.keys()[0]) == str:
+ elif type(list(tolinux.keys())[0]) == str:
fromtype = self.TYPE_STRING
else:
fromtype = self.TYPE_INT
if tomapname in database.ENUM_COLUMNS:
totype = self.TYPE_ENUM
- elif type(fromlinux.values()[0]) == str:
+ elif type(list(fromlinux.values())[0]) == str:
totype = self.TYPE_STRING
else:
totype = self.TYPE_INT
- keys = tolinux.keys()
+ keys = list(tolinux.keys())
keys.sort()
if fromtype == self.TYPE_INT:
keys = range(keys[-1] + 1)
@@ -402,7 +402,7 @@ class LanguageSrcGenerator(LanguageGenerator):
raise Exception("Unknown map %s, expected one of %s" % (
mapname, ", ".join(database.mapto.keys())))
- keys = database.mapto[Database.MAP_LINUX].keys()
+ keys = list(database.mapto[Database.MAP_LINUX].keys())
keys.sort()
names = [database.mapname[Database.MAP_LINUX].get(key, "unnamed") for key in keys]
@@ -411,7 +411,7 @@ class LanguageSrcGenerator(LanguageGenerator):
if mapname in database.ENUM_COLUMNS:
totype = self.TYPE_ENUM
- elif type(database.mapto[mapname].values()[0]) == str:
+ elif type(list(database.mapto[mapname].values())[0]) == str:
totype = self.TYPE_STRING
else:
totype = self.TYPE_INT
@@ -440,7 +440,7 @@ class LanguageSrcGenerator(LanguageGenerator):
if varname is None:
varname = "name_map_%s_to_%s" % (frommapname, tomapname)
- keys = tolinux.keys()
+ keys = list(tolinux.keys())
keys.sort()
if type(keys[0]) == int:
keys = range(keys[-1] + 1)
@@ -470,7 +470,7 @@ class LanguageSrcGenerator(LanguageGenerator):
raise Exception("Unknown map %s, expected one of %s" % (
mapname, ", ".join(database.mapname.keys())))
- keys = database.mapto[Database.MAP_LINUX].keys()
+ keys = list(database.mapto[Database.MAP_LINUX].keys())
keys.sort()
names = [database.mapname[Database.MAP_LINUX].get(key, "unnamed") for key in keys]
@@ -514,7 +514,7 @@ class LanguageDocGenerator(LanguageGenerator):
raise Exception("Unknown map %s, expected one of %s" % (
mapname, ", ".join(database.mapname.keys())))
- keys = database.mapto[Database.MAP_LINUX].keys()
+ keys = list(database.mapto[Database.MAP_LINUX].keys())
keys.sort()
names = [database.mapname[Database.MAP_LINUX].get(key, "unnamed") for key in keys]
@@ -537,7 +537,7 @@ class LanguageDocGenerator(LanguageGenerator):
mapname, ", ".join(database.mapfrom.keys())))
tolinux = database.mapfrom[mapname]
- keys = tolinux.keys()
+ keys = list(tolinux.keys())
keys.sort()
if mapname in database.mapname:
names = database.mapname[mapname]
--
libgit2 0.26.0