Merge "Port zonemanager to Python 3"

This commit is contained in:
Jenkins 2015-12-21 20:17:20 +00:00 committed by Gerrit Code Review
commit e1ae777bdc
6 changed files with 22 additions and 11 deletions

View File

@ -19,6 +19,7 @@
import mock
from oslo_concurrency import processutils
from six.moves import range
from cinder import exception
from cinder import test
@ -219,7 +220,7 @@ class TestCiscoFCZoneClientCLI(cli.CiscoFCZoneClientCLI, test.TestCase):
expected_num_calls = 5
expected_calls = []
for i in xrange(expected_num_calls):
for i in range(expected_num_calls):
expected_calls.append(mock.call(cmd_list, True))
self.assertEqual(expected_num_calls, run_ssh_mock.call_count)

View File

@ -139,10 +139,10 @@ class BrcdFCSanLookupService(fc_service.FCSanLookupService):
"caller-%s", formatted_initiator_list)
LOG.debug("Lookup service:target list from "
"caller-%s", formatted_target_list)
visible_targets = filter(lambda x: x in formatted_target_list,
nsinfo)
visible_initiators = filter(lambda x: x in
formatted_initiator_list, nsinfo)
visible_targets = [x for x in nsinfo
if x in formatted_target_list]
visible_initiators = [x for x in nsinfo
if x in formatted_initiator_list]
if visible_targets:
LOG.debug("Filtered targets is: %s", visible_targets)

View File

@ -105,7 +105,7 @@ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
if len(wwn_str) != 16:
return wwn_str
else:
return ':'.join(
return b':'.join(
[wwn_str[i:i + 2] for i in range(0, len(wwn_str), 2)])
@lockutils.synchronized('brcd', 'fcfabric-', True)

View File

@ -137,10 +137,10 @@ class CiscoFCSanLookupService(fc_service.FCSanLookupService):
formatted_initiator_list)
LOG.debug("Lookup service:target list from caller-%s",
formatted_target_list)
visible_targets = filter(lambda x: x in formatted_target_list,
nsinfo)
visible_initiators = filter(lambda x: x in
formatted_initiator_list, nsinfo)
visible_targets = [x for x in nsinfo
if x in formatted_target_list]
visible_initiators = [x for x in nsinfo
if x in formatted_initiator_list]
if visible_targets:
LOG.debug("Filtered targets is: %s", visible_targets)

View File

@ -81,7 +81,7 @@ class ZoneManager(fc_common.FCCommon):
def __new__(class_, *args, **kwargs):
if not hasattr(class_, "_instance"):
class_._instance = object.__new__(class_, *args, **kwargs)
class_._instance = object.__new__(class_)
return class_._instance
def __init__(self, **kwargs):

View File

@ -156,3 +156,13 @@ cinder.tests.unit.windows.test_windows
cinder.tests.unit.windows.test_windows_remotefs
cinder.tests.unit.windows.test_windows_utils
cinder.tests.unit.wsgi
cinder.tests.unit.zonemanager.test_brcd_fc_san_lookup_service
cinder.tests.unit.zonemanager.test_brcd_fc_zone_client_cli
cinder.tests.unit.zonemanager.test_brcd_fc_zone_driver
cinder.tests.unit.zonemanager.test_brcd_lookup_service
cinder.tests.unit.zonemanager.test_cisco_fc_san_lookup_service
cinder.tests.unit.zonemanager.test_cisco_fc_zone_client_cli
cinder.tests.unit.zonemanager.test_cisco_fc_zone_driver
cinder.tests.unit.zonemanager.test_cisco_lookup_service
cinder.tests.unit.zonemanager.test_fc_zone_manager
cinder.tests.unit.zonemanager.test_volume_driver