diff --git a/cinder/tests/test_storwize_svc.py b/cinder/tests/test_storwize_svc.py index 39a06dfab1d..ea602d45533 100644 --- a/cinder/tests/test_storwize_svc.py +++ b/cinder/tests/test_storwize_svc.py @@ -1931,7 +1931,7 @@ class StorwizeSVCDriverTestCase(test.TestCase): types[protocol] = volume_types.create(ctxt, protocol, opts) expected = {'FC': {'driver_volume_type': 'fibre_channel', - 'data': {'target_lun': '0', + 'data': {'target_lun': 0, 'target_wwn': 'AABBCCDDEEFF0011', 'target_discovered': False}}, 'iSCSI': {'driver_volume_type': 'iscsi', @@ -1939,7 +1939,7 @@ class StorwizeSVCDriverTestCase(test.TestCase): 'target_iqn': 'iqn.1982-01.com.ibm:1234.sim.node1', 'target_portal': '1.234.56.78:3260', - 'target_lun': '0', + 'target_lun': 0, 'auth_method': 'CHAP'}}} for protocol in ['FC', 'iSCSI']: @@ -2547,7 +2547,7 @@ class StorwizeSVCDriverTestCase(test.TestCase): {'ff00000000000000': ['AABBCCDDEEFF0011'], 'ff00000000000001': ['AABBCCDDEEFF0011']}, 'target_discovered': False, - 'target_lun': '0', + 'target_lun': 0, 'target_wwn': 'AABBCCDDEEFF0011', 'volume_id': volume['id'] } diff --git a/cinder/volume/drivers/ibm/storwize_svc/helpers.py b/cinder/volume/drivers/ibm/storwize_svc/helpers.py index 558117526a4..d2f6ee97ffb 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/helpers.py +++ b/cinder/volume/drivers/ibm/storwize_svc/helpers.py @@ -308,7 +308,7 @@ class StorwizeHelpers(object): {'result_lun': result_lun, 'volume_name': volume_name, 'host_name': host_name}) - return result_lun + return int(result_lun) def unmap_vol_from_host(self, volume_name, host_name): """Unmap the volume and delete the host if it has no more mappings."""