Irit Goihman has uploaded a new change for review.
Change subject: wip: py3: port storage misc.py file to python3 ......................................................................
wip: py3: port storage misc.py file to python3
Change-Id: I1adec40146967965329024718c6ff48d0fa089fb Signed-off-by: Irit Goihman igoihman@redhat.com --- M lib/vdsm/storage/misc.py 1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/60001/1
diff --git a/lib/vdsm/storage/misc.py b/lib/vdsm/storage/misc.py index 173d608..162570e 100644 --- a/lib/vdsm/storage/misc.py +++ b/lib/vdsm/storage/misc.py @@ -33,7 +33,6 @@ import inspect import logging import os -import Queue import random import re import signal @@ -46,7 +45,8 @@ from array import array from collections import defaultdict from functools import wraps, partial -from itertools import chain, imap +from itertools import chain +from six.moves import queue, map, range
from vdsm import commands from vdsm import concurrent @@ -69,7 +69,7 @@
def namedtuple2dict(nt): - return dict(imap(lambda f: (f, getattr(nt, f)), nt._fields)) + return dict(map(lambda f: (f, getattr(nt, f)), nt._fields))
class _LogSkip(object): @@ -95,7 +95,7 @@
def logskip(var): - if isinstance(var, types.StringTypes): + if isinstance(var, (str,)): return lambda func: _LogSkip.wrap(func, var) return _LogSkip.wrap(var, None)
@@ -423,7 +423,7 @@ Raises InvalidParameterException if value is not a string or if it could not be converted to integer. """ - if not isinstance(size, basestring): + if not isinstance(size, six.string_types): log.error("Number of sectors as int is not supported, use size in " "bytes as string") raise se.InvalidParameterException("size", size) @@ -669,7 +669,7 @@ if maxthreads < 1 and maxthreads != UNLIMITED_THREADS: raise ValueError("Wrong input to function itmap: %s", maxthreads)
- respQueue = Queue.Queue() + respQueue = queue.Queue()
def wrapper(value): try: @@ -699,7 +699,7 @@ maxthreads -= 1
# waiting for rest threads to end - for i in xrange(threadsCount): + for i in range(threadsCount): yield respQueue.get()
gerrit-hooks has posted comments on this change.
Change subject: wip: py3: port storage misc.py file to python3 ......................................................................
Patch Set 1:
* Update tracker: IGNORE, no Bug-Url found
Irit Goihman has abandoned this change.
Change subject: wip: py3: port storage misc.py file to python3 ......................................................................
Abandoned
duplicate
vdsm-patches@lists.fedorahosted.org