Port hitachi driver to Python 3
* On Python 3, shlex expects Unicode, not bytes: don't encode * Replace map() with list-comprehension where a list is expected. * tox.ini: add cinder.tests.unit.test_hitachi_hbsd_horcm_fc to Python 3.4 Blueprint cinder-python3 Change-Id: Id0db0dabef98f7dd8331a5149e88dee0622917b3
This commit is contained in:
@@ -244,7 +244,7 @@ class HBSDBasicLib(object):
|
||||
cmd = [cmd]
|
||||
|
||||
if args:
|
||||
if isinstance(args, six.text_type):
|
||||
if six.PY2 and isinstance(args, six.text_type):
|
||||
cmd += shlex.split(args.encode())
|
||||
else:
|
||||
cmd += shlex.split(args)
|
||||
|
||||
@@ -167,7 +167,7 @@ class HBSDHORCM(basic_lib.HBSDBasicLib):
|
||||
if not i.isdigit():
|
||||
msg = basic_lib.output_err(601, param='hitachi_horcm_numbers')
|
||||
raise exception.HBSDError(message=msg)
|
||||
self.conf.hitachi_horcm_numbers = map(int, numbers)
|
||||
self.conf.hitachi_horcm_numbers = [int(num) for num in numbers]
|
||||
inst = self.conf.hitachi_horcm_numbers[0]
|
||||
pair_inst = self.conf.hitachi_horcm_numbers[1]
|
||||
if inst == pair_inst:
|
||||
|
||||
1
tox.ini
1
tox.ini
@@ -49,6 +49,7 @@ commands =
|
||||
cinder.tests.unit.test_evaluator \
|
||||
cinder.tests.unit.test_exception \
|
||||
cinder.tests.unit.test_gpfs \
|
||||
cinder.tests.unit.test_hitachi_hbsd_horcm_fc \
|
||||
cinder.tests.unit.test_hitachi_hbsd_snm2_fc \
|
||||
cinder.tests.unit.test_hitachi_hbsd_snm2_iscsi \
|
||||
cinder.tests.unit.test_hp_xp_fc \
|
||||
|
||||
Reference in New Issue
Block a user