result = self.driver._get_active_fc_targets()
- self.assertEqual(['2100001b9745e230', '2100001b9745e25f',
- '2100001b9745e231', '2100001b9745e25e'],
- result)
+ self.assertEqual({'2100001b9745e230', '2100001b9745e25f',
+ '2100001b9745e231', '2100001b9745e25e'},
+ set(result))
def test_initialize_connection(self):
lun_id = 1
ret_dict = self.vip.basic.get_node_values(
"/vshare/state/local/container/*")
if ret_dict:
- self.container = ret_dict.items()[0][1]
+ self.container = list(ret_dict.items())[0][1]
def check_for_setup_error(self):
"""Returns an error if prerequisites aren't met."""
free_gb = 0
v = self.common.vip
- master_cluster_id = v.basic.get_node_values(
- '/cluster/state/master_id').values()[0]
+ master_cluster_id = list(v.basic.get_node_values(
+ '/cluster/state/master_id').values())[0]
bn1 = "/vshare/state/global/%s/container/%s/total_bytes" \
% (master_cluster_id, self.common.container)
resp = v.basic.get_node_values([bn1, bn2])
if bn1 in resp:
- total_gb = resp[bn1] / units.Gi
+ total_gb = resp[bn1] // units.Gi
else:
LOG.warning(_LW("Failed to receive update for total_gb stat!"))
if 'total_capacity_gb' in self.stats:
total_gb = self.stats['total_capacity_gb']
if bn2 in resp:
- free_gb = resp[bn2] / units.Gi
+ free_gb = resp[bn2] // units.Gi
else:
LOG.warning(_LW("Failed to receive update for free_gb stat!"))
if 'free_capacity_gb' in self.stats:
free_gb = 0
v = self.common.vip
- master_cluster_id = v.basic.get_node_values(
- '/cluster/state/master_id').values()[0]
+ master_cluster_id = list(v.basic.get_node_values(
+ '/cluster/state/master_id').values())[0]
bn1 = "/vshare/state/global/%s/container/%s/total_bytes" \
% (master_cluster_id, self.common.container)
resp = v.basic.get_node_values([bn1, bn2])
if bn1 in resp:
- total_gb = resp[bn1] / units.Gi
+ total_gb = resp[bn1] // units.Gi
else:
LOG.warning(_LW("Failed to receive update for total_gb stat!"))
if 'total_capacity_gb' in self.stats:
total_gb = self.stats['total_capacity_gb']
if bn2 in resp:
- free_gb = resp[bn2] / units.Gi
+ free_gb = resp[bn2] // units.Gi
else:
LOG.warning(_LW("Failed to receive update for free_gb stat!"))
if 'free_capacity_gb' in self.stats:
ret_dict = conn.basic.get_node_values("/system/hostname")
if ret_dict:
- hostname = ret_dict.items()[0][1]
+ hostname = list(ret_dict.items())[0][1]
else:
LOG.debug("Unable to fetch gateway hostname for %s.", mg_to_query)
thin_lun = True
# Set the actual allocation size for thin lun
# default here is 10%
- size_mb = size_mb / 10
+ size_mb = size_mb // 10
typeid = volume['volume_type_id']
if typeid:
thin_lun = True
# Set the actual allocation size for thin lun
# default here is 10%
- size_mb = size_mb / 10
+ size_mb = size_mb // 10
spec_value = self._get_volume_type_extra_spec(volume, "dedup")
if spec_value and spec_value.lower() == "true":
# Set the actual allocation size for thin lun
# default here is 10%. The actual allocation may
# different, depending on other factors
- size_mb = full_size_mb / 10
+ size_mb = full_size_mb // 10
# Extract the storage_pool name if one is specified
pool = self._get_violin_extra_spec(volume, "storage_pool")
if typeid:
volume_type = volume_types.get_volume_type(ctxt, typeid)
volume_specs = volume_type.get('extra_specs')
- for key, val in volume_specs.iteritems():
+ for key, val in volume_specs.items():
# Strip the prefix "capabilities"
if ':' in key:
if typeid:
volume_type = volume_types.get_volume_type(ctxt, typeid)
volume_specs = volume_type.get('extra_specs')
- for key, val in volume_specs.iteritems():
+ for key, val in volume_specs.items():
# Strip the prefix "violin"
if ':' in key:
for x in all_devices:
if socket.getfqdn(x['owner']) == array_name:
- total_gb += x['size_mb'] / 1024
- free_gb += x['availsize_mb'] / 1024
+ total_gb += x['size_mb'] // 1024
+ free_gb += x['availsize_mb'] // 1024
backend_name = self.configuration.volume_backend_name
data['volume_backend_name'] = backend_name or self.__class__.__name__
active_gw_fcp_wwns = []
fc_info = v.adapter.get_fc_info()
- for x in fc_info.itervalues():
+ for x in fc_info.values():
active_gw_fcp_wwns.append(x[0])
return active_gw_fcp_wwns
cinder.tests.unit.test_test
cinder.tests.unit.test_test_utils
cinder.tests.unit.test_v6000_common
+cinder.tests.unit.test_v6000_fcp
+cinder.tests.unit.test_v6000_iscsi
+cinder.tests.unit.test_v7000_common
+cinder.tests.unit.test_v7000_fcp
cinder.tests.unit.test_vmware_vmdk
cinder.tests.unit.test_vmware_volumeops
cinder.tests.unit.test_volume