]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Port IBM storewize_svc driver to Python 3
authorVictor Stinner <vstinner@redhat.com>
Sun, 8 Nov 2015 21:36:01 +0000 (22:36 +0100)
committerVictor Stinner <vstinner@redhat.com>
Tue, 24 Nov 2015 11:15:24 +0000 (12:15 +0100)
commitad821f2864cd860d1d198587a441846db4b81e81
tree5bcca9474bc0b6670f938b927412972800b887d2
parentcbd26a4143bdbe10a17298d3318ddb2da6a136a8
Port IBM storewize_svc driver to Python 3

Change default preferred node in
StorwizeSVCDriver.initialize_connection(). For fiber channel without
multipath, pick the first node from the list of sorted nodes, to have
a determinist preferred node. The list of nodes is created indirectly
using list(set(nodes)) which doesn't have a determinist order. On
Python 3, the hash function is randomized, and so list(set()) has an
unknown order.

A similar change was done for volume throttling in the change
Icf7141f772397c7ac08f0f1e21ad74cb86a06351 to port the code
to Python 3.

Other changes:

* Use assertSetEqual() in test_storwize_svc to compare
  initiator_target_map, because conn_wwpns has a random order on
  Python 3.
* StorwizeSVCDriver._check_volume_copy_ops(): replace dict.items()
  with list(dict.items()) to iterate on items. On Python 3,
  dict.items() now returns a view instead of a copy. The loop
  modifies the dictionary and a dict must not be modified while
  iterating on it, we really need a copy of items.
* StorwizeHelpers: replace a/b with a//b to use integer division on
  Python 3.
* tests-py3.txt: add cinder.tests.unit.test_storwize_svc

Partial-Implements: blueprint cinder-python3
Change-Id: I534a85928816d6cce921545e1820311aedd1b884
cinder/volume/drivers/ibm/storwize_svc/__init__.py
cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py
tests-py3.txt