]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Drop L suffix from long integers
authorVictor Stinner <vstinner@redhat.com>
Wed, 10 Jun 2015 12:28:38 +0000 (14:28 +0200)
committerVictor Stinner <vstinner@redhat.com>
Tue, 16 Jun 2015 08:44:49 +0000 (10:44 +0200)
Replace 123L with 123 to make Cinder code compatible with Python 3.

This patch was generated by the long operation of the sixer tool:
https://pypi.python.org/pypi/sixer

Manual changes:

* hp_3par_common: bump version

Blueprint cinder-python3
Change-Id: I3086d3e3d9c3ede358313bdd43d1eee9cfdafe15

cinder/tests/unit/test_backup_tsm.py
cinder/tests/unit/test_emc_vmax.py
cinder/tests/unit/test_emc_vnxdirect.py
cinder/volume/drivers/emc/emc_vmax_fast.py
cinder/volume/drivers/emc/emc_vmax_masking.py
cinder/volume/drivers/emc/emc_vmax_provision.py
cinder/volume/drivers/emc/emc_vmax_provision_v3.py
cinder/volume/drivers/emc/emc_vmax_utils.py
cinder/volume/drivers/san/hp/hp_3par_common.py

index 054c977a1f91c70369adf7e6e3c631198b5f0d37..b3c4a908e9e6ddf60788d8a07db3b20009c1427e 100644 (file)
@@ -212,7 +212,7 @@ def fake_stat_image(path):
     # Simulate stat to return the mode of a block device
     # make sure that st_mode (the first in the sequence(
     # matches the mode of a block device
-    return posix.stat_result((25008, 5753, 5L, 1, 0, 6, 0,
+    return posix.stat_result((25008, 5753, 5, 1, 0, 6, 0,
                               1375881199, 1375881197, 1375881197))
 
 
@@ -220,7 +220,7 @@ def fake_stat_file(path):
     # Simulate stat to return the mode of a block device
     # make sure that st_mode (the first in the sequence(
     # matches the mode of a block device
-    return posix.stat_result((33188, 5753, 5L, 1, 0, 6, 0,
+    return posix.stat_result((33188, 5753, 5, 1, 0, 6, 0,
                               1375881199, 1375881197, 1375881197))
 
 
@@ -228,7 +228,7 @@ def fake_stat_illegal(path):
     # Simulate stat to return the mode of a block device
     # make sure that st_mode (the first in the sequence(
     # matches the mode of a block device
-    return posix.stat_result((17407, 5753, 5L, 1, 0, 6, 0,
+    return posix.stat_result((17407, 5753, 5, 1, 0, 6, 0,
                               1375881199, 1375881197, 1375881197))
 
 
index 8fe9d059a61aab496992bd45c98188d933d9bf00..45543c29ec6b5a4a102999cb8a82b202ad60ba44 100644 (file)
@@ -143,7 +143,7 @@ class Fake_CIMProperty(object):
 
     def fake_getSupportedReplicationTypes(self):
         cimproperty = Fake_CIMProperty()
-        cimproperty.value = [2L, 10L]
+        cimproperty.value = [2, 10]
         return cimproperty
 
 
@@ -468,7 +468,7 @@ class FakeEcomConnection(object):
                      DeviceMaskingGroup=None, TargetMaskingGroup=None,
                      ProtocolController=None, StorageID=None, IDType=None):
 
-        rc = 0L
+        rc = 0
         myjob = SE_ConcreteJob()
         myjob.classname = 'SE_ConcreteJob'
         myjob['InstanceID'] = '9999'
@@ -477,7 +477,7 @@ class FakeEcomConnection(object):
 
         if Size == -1073741824 and \
                 MethodName == 'CreateOrModifyCompositeElement':
-            rc = 0L
+            rc = 0
             myjob = SE_ConcreteJob()
             myjob.classname = 'SE_ConcreteJob'
             myjob['InstanceID'] = '99999'
@@ -486,16 +486,16 @@ class FakeEcomConnection(object):
 
         if ElementName == 'failed_vol' and \
                 MethodName == 'CreateOrModifyElementFromStoragePool':
-            rc = 10L
+            rc = 10
             myjob['status'] = 'failure'
 
         elif TheElements and \
                 TheElements[0]['DeviceID'] == '99999' and \
                 MethodName == 'EMCReturnToStoragePool':
-            rc = 10L
+            rc = 10
             myjob['status'] = 'failure'
         elif HardwareId:
-            rc = 0L
+            rc = 0
             targetendpoints = {}
             endpoints = []
             endpoint = {}
@@ -510,13 +510,13 @@ class FakeEcomConnection(object):
             return rc, targetendpoints
         elif ReplicationType and \
                 MethodName == 'GetDefaultReplicationSettingData':
-            rc = 0L
+            rc = 0
             rsd = SE_ReplicationSettingData()
             rsd['DefaultInstance'] = SE_ReplicationSettingData()
             return rc, rsd
         if MethodName == 'CreateStorageHardwareID':
             ret = {}
-            rc = 0L
+            rc = 0
             ret['HardwareID'] = self.data.iscsi_initiator
             return rc, ret
 
@@ -2674,7 +2674,7 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
         volumeDict = {'classname': u'Symm_StorageVolume',
                       'keybindings': EMCVMAXCommonData.keybindings}
         common.provision.create_volume_from_pool = (
-            mock.Mock(return_value=(volumeDict, 0L)))
+            mock.Mock(return_value=(volumeDict, 0)))
         common.provision.get_volume_dict_from_job = (
             mock.Mock(return_value=volumeDict))
         self.driver.create_snapshot(self.data.test_volume)
@@ -2771,7 +2771,7 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
         self.data.test_volume['volume_name'] = "vmax-1234567"
         e = exception.VolumeBackendAPIException('CreateElementReplica Ex')
         common = self.driver.common
-        common._delete_from_pool = mock.Mock(return_value=0L)
+        common._delete_from_pool = mock.Mock(return_value=0)
         conn = self.fake_ecom_connection()
         storageConfigService = (
             common.utils.find_storage_configuration_service(
@@ -2929,14 +2929,14 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
         common = self.driver.common
         volumeDict = {'classname': u'Symm_StorageVolume',
                       'keybindings': EMCVMAXCommonData.keybindings}
-        volume = {'size': 0L}
+        volume = {'size': 0}
         common.provision.create_volume_from_pool = (
             mock.Mock(return_value=(volumeDict, volume['size'])))
         common.provision.get_volume_dict_from_job = (
             mock.Mock(return_value=volumeDict))
 
         common._create_composite_volume = (
-            mock.Mock(return_value=(0L,
+            mock.Mock(return_value=(0,
                                     volumeDict,
                                     EMCVMAXCommonData.storage_system)))
 
@@ -3416,7 +3416,7 @@ class EMCVMAXISCSIDriverFastTestCase(test.TestCase):
         volumeDict = {'classname': u'Symm_StorageVolume',
                       'keybindings': EMCVMAXCommonData.keybindings}
         common.provision.create_volume_from_pool = (
-            mock.Mock(return_value=(volumeDict, 0L)))
+            mock.Mock(return_value=(volumeDict, 0)))
         common.provision.get_volume_dict_from_job = (
             mock.Mock(return_value=volumeDict))
         common.fast.is_volume_in_default_SG = (
@@ -3504,7 +3504,7 @@ class EMCVMAXISCSIDriverFastTestCase(test.TestCase):
             mock_policy, mock_meta, mock_size, mock_pool):
         self.data.test_volume['volume_name'] = "vmax-1234567"
         self.driver.common._modify_and_get_composite_volume_instance = (
-            mock.Mock(return_value=(1L, None)))
+            mock.Mock(return_value=(1, None)))
         self.assertRaises(exception.VolumeBackendAPIException,
                           self.driver.create_cloned_volume,
                           self.data.test_volume,
@@ -4624,7 +4624,7 @@ class EMCVMAXFCDriverFastTestCase(test.TestCase):
         volumeDict = {'classname': u'Symm_StorageVolume',
                       'keybindings': EMCVMAXCommonData.keybindings}
         common.provision.create_volume_from_pool = (
-            mock.Mock(return_value=(volumeDict, 0L)))
+            mock.Mock(return_value=(volumeDict, 0)))
         common.provision.get_volume_dict_from_job = (
             mock.Mock(return_value=volumeDict))
         common.fast.is_volume_in_default_SG = (
@@ -4731,7 +4731,7 @@ class EMCVMAXFCDriverFastTestCase(test.TestCase):
             mock_meta, mock_size, mock_pool):
         self.data.test_volume['volume_name'] = "vmax-1234567"
         self.driver.common._modify_and_get_composite_volume_instance = (
-            mock.Mock(return_value=(1L, None)))
+            mock.Mock(return_value=(1, None)))
         self.assertRaises(exception.VolumeBackendAPIException,
                           self.driver.create_cloned_volume,
                           self.data.test_volume,
@@ -5287,7 +5287,7 @@ class EMCV3DriverTestCase(test.TestCase):
             self, _mock_volume_type, _mock_storage, _mock_cg, _mock_members,
             mock_rg):
         provisionv3 = self.driver.common.provisionv3
-        provisionv3.create_group_replica = mock.Mock(return_value=(0L, None))
+        provisionv3.create_group_replica = mock.Mock(return_value=(0, None))
         self.driver.create_cgsnapshot(
             self.data.test_ctxt, self.data.test_CG_snapshot)
         repServ = self.conn.EnumerateInstanceNames("EMC_ReplicationService")[0]
@@ -5415,13 +5415,13 @@ class EMCV3DriverTestCase(test.TestCase):
         volumeDict = {'classname': u'Symm_StorageVolume',
                       'keybindings': EMCVMAXCommonData.keybindings}
         common._create_v3_volume = (
-            mock.Mock(return_value=(0L, volumeDict, self.data.storage_system)))
+            mock.Mock(return_value=(0, volumeDict, self.data.storage_system)))
         conn = self.fake_ecom_connection()
         storageConfigService = {}
         storageConfigService['SystemName'] = EMCVMAXCommonData.storage_system
         storageConfigService['CreationClassName'] = \
             self.data.stconf_service_creationclass
-        common._delete_from_pool_v3 = mock.Mock(return_value=0L)
+        common._delete_from_pool_v3 = mock.Mock(return_value=0)
         mock_create_replica.side_effect = e
         self.assertRaises(exception.VolumeBackendAPIException,
                           self.driver.create_cloned_volume,
index 2edfa4302bc1a4986de964b6f39277b5592083a7..1e10c29d09d7680b13a4405b132dc8298ff16dda 100644 (file)
@@ -287,7 +287,7 @@ class EMCVNXCLIDriverTestData(object):
     test_volume4 = {'migration_status': None, 'availability_zone': 'nova',
                     'id': '1181d1b2-cea3-4f55-8fa8-3360d026ce24',
                     'name': 'vol4',
-                    'size': 2L,
+                    'size': 2,
                     'status': 'available',
                     'volume_type_id':
                     '19fdd0dd-03b3-4d7c-b541-f4df46f308c8',
index a70054f1c9b8b3462258af4fa1faf564a0e82b12..1c3a24ea31886df637421a85673891e6cd786437 100644 (file)
@@ -317,10 +317,10 @@ class EMCVMAXFast(object):
             PolicyRule=tierPolicyRuleInstanceName,
             Operation=self.utils.get_num(modificationType, '16'),
             InElements=[storageGroupInstanceName])
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error associating storage group : %(storageGroupName)s. "
                     "To fast Policy: %(fastPolicyName)s with error "
@@ -585,10 +585,10 @@ class EMCVMAXFast(object):
                 PolicyRule=tierPolicyRuleInstanceName,
                 Operation=self.utils.get_num(modificationType, '16'),
                 InElements=[storageGroupInstanceName])
-            if rc != 0L:
+            if rc != 0:
                 rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                                  extraSpecs)
-                if rc != 0L:
+                if rc != 0:
                     LOG.error(_LE("Error disassociating storage group from "
                               "policy: %s."), errordesc)
                 else:
index 2a0d0a36890b30332ba84cf0a43b03faa2794218..9725cef7e7b6aadda9eb27221220980e0cd02758 100644 (file)
@@ -1016,10 +1016,10 @@ class EMCVMAXMasking(object):
             DeviceMaskingGroup=deviceMaskingGroup,
             TargetMaskingGroup=targetMaskingGroup)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Masking View: %(groupName)s. "
                     "Return code: %(rc)lu. Error: %(error)s.")
@@ -1459,10 +1459,10 @@ class EMCVMAXMasking(object):
             Type=self.utils.get_num(INITIATORGROUPTYPE, '16'),
             Members=[hardwareIdinstanceNames[0]])
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Group: %(groupName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -1483,11 +1483,11 @@ class EMCVMAXMasking(object):
                     MaskingGroup=foundInitiatorGroupInstanceName,
                     Members=[hardwareIdinstanceNames[j]])
 
-                if rc != 0L:
+                if rc != 0:
                     rc, errordesc = (
                         self.utils.wait_for_job_complete(conn, job,
                                                          extraSpecs))
-                    if rc != 0L:
+                    if rc != 0:
                         exceptionMessage = (_(
                             "Error adding initiator to group : %(groupName)s. "
                             "Return code: %(rc)lu.  Error: %(error)s.")
@@ -1544,10 +1544,10 @@ class EMCVMAXMasking(object):
                                     controllerConfigService,
                                     ProtocolController=maskingViewInstanceName)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Modifying masking view : %(groupName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -2300,10 +2300,10 @@ class EMCVMAXMasking(object):
             MaskingGroup=storageGroupInstanceName,
             Force=True)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Deleting Group: %(storageGroupName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s")
index 64433259eaa5e88727bb2ab2b571e58fa20811bc..0ef3361fbcd4e0e3011c53fa6044379d30c706db 100644 (file)
@@ -67,10 +67,10 @@ class EMCVMAXProvision(object):
             'EMCReturnToStoragePool', storageConfigservice,
             TheElements=theElements)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Delete Volume: %(volumeName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -117,10 +117,10 @@ class EMCVMAXProvision(object):
                   {'volumename': volumeName,
                    'rc': rc})
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Volume: %(volumeName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -161,10 +161,10 @@ class EMCVMAXProvision(object):
             Type=self.utils.get_num(STORAGEGROUPTYPE, '16'),
             Members=[volumeInstanceName])
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Group: %(groupName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -202,10 +202,10 @@ class EMCVMAXProvision(object):
             Type=self.utils.get_num(STORAGEGROUPTYPE, '16'),
             DeleteWhenBecomesUnassociated=False)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Group: %(groupName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -283,10 +283,10 @@ class EMCVMAXProvision(object):
                                         controllerConfigService,
                                         MaskingGroup=storageGroupInstanceName,
                                         Members=[volumeInstanceName])
-        if rc != 0L:
+        if rc != 0:
             rc, errorDesc = self.utils.wait_for_job_complete(conn, jobDict,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error removing volume %(vol)s. %(error)s.")
                     % {'vol': volumeName, 'error': errorDesc})
@@ -321,10 +321,10 @@ class EMCVMAXProvision(object):
             MaskingGroup=storageGroupInstanceName,
             Members=[volumeInstanceName])
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error mapping volume %(vol)s. %(error)s.")
                     % {'vol': volumeName, 'error': errordesc})
@@ -361,10 +361,10 @@ class EMCVMAXProvision(object):
             InPool=poolInstanceName,
             TheElement=volumeInstanceName)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error unbinding volume %(vol)s from pool. %(error)s.")
                     % {'vol': volumeName, 'error': errordesc})
@@ -403,10 +403,10 @@ class EMCVMAXProvision(object):
             TheElement=theVolumeInstanceName,
             InElements=[inVolumeInstanceName])
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error adding volume to composite volume. "
                     "Error is: %(error)s.")
@@ -470,10 +470,10 @@ class EMCVMAXProvision(object):
             CompositeType=self.utils.get_num(compositeType, '16'),
             EMCNumberOfMembers=self.utils.get_num(numMembers, '32'))
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Volume: %(volumename)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -522,10 +522,10 @@ class EMCVMAXProvision(object):
                 [compositeHeadInstanceName, compositeMemberInstanceName]),
             CompositeType=self.utils.get_num(compositeType, '16'))
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Creating new composite Volume Return code: "
                     "%(rc)lu. Error: %(error)s.")
@@ -564,10 +564,10 @@ class EMCVMAXProvision(object):
             TheElements=[volumeInstanceName],
             TargetPool=targetPoolInstanceName)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Migrating volume from one pool to another. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -655,10 +655,10 @@ class EMCVMAXProvision(object):
         rc, job = conn.InvokeMethod(
             'RequestStateChange', volumeInstanceName,
             RequestedState=self.utils.get_num(32769, '16'))
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Terminating migrate session. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -708,10 +708,10 @@ class EMCVMAXProvision(object):
                 repServiceCapabilityInstanceName,
                 ReplicationType=self.utils.get_num(10, '16'))
 
-            if rc != 0L:
+            if rc != 0:
                 rc, errordesc = self.utils.wait_for_job_complete(conn, rsd,
                                                                  extraSpecs)
-                if rc != 0L:
+                if rc != 0:
                     exceptionMessage = (_(
                         "Error creating cloned volume using "
                         "Volume: %(cloneName)s, Source Volume: "
@@ -759,10 +759,10 @@ class EMCVMAXProvision(object):
                     SourceElement=sourceInstance.path,
                     TargetElement=targetInstance.path)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Cloned Volume: "
                     "Volume: %(cloneName)s  Source Volume:"
@@ -815,10 +815,10 @@ class EMCVMAXProvision(object):
                   {'syncName': syncInstanceName,
                    'rc': rc})
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error break clone relationship: "
                     "Sync Name: %(syncName)s "
@@ -853,7 +853,7 @@ class EMCVMAXProvision(object):
             'EMCGetTargetEndpoints', storageHardwareService,
             HardwareId=hardwareId)
 
-        if rc != 0L:
+        if rc != 0:
             exceptionMessage = (_("Error finding Target WWNs."))
             LOG.error(exceptionMessage)
             raise exception.VolumeBackendAPIException(data=exceptionMessage)
@@ -884,10 +884,10 @@ class EMCVMAXProvision(object):
             replicationService,
             GroupName=consistencyGroupName)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Failed to create consistency group: "
                     "%(consistencyGroupName)s  "
@@ -929,10 +929,10 @@ class EMCVMAXProvision(object):
             ReplicationGroup=cgInstanceName,
             RemoveElements=True)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Failed to delete consistency group: "
                     "%(consistencyGroupName)s "
@@ -975,10 +975,10 @@ class EMCVMAXProvision(object):
             Members=[volumeInstanceName],
             ReplicationGroup=cgInstanceName)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Failed to add volume %(volumeName)s: "
                     "to consistency group %(cgName)s "
@@ -1022,10 +1022,10 @@ class EMCVMAXProvision(object):
             ReplicationGroup=cgInstanceName,
             RemoveElements=True)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Failed to remove volume %(volumeName)s: "
                     "to consistency group %(cgName)s "
@@ -1079,10 +1079,10 @@ class EMCVMAXProvision(object):
             TargetGroup=tgtGroupInstanceName,
             SyncType=self.utils.get_num(8, '16'))
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMsg = (_("Error CreateGroupReplica: "
                                   "source: %(source)s target: %(target)s. "
                                   "Return code: %(rc)lu. Error: %(error)s.")
index d3e191d525145e1b587a1bee43df8504414d8524..2aa8cd30cb09c7e2f9630b6517dff000f0b0b6b5 100644 (file)
@@ -66,10 +66,10 @@ class EMCVMAXProvisionV3(object):
             'ReturnElementsToStoragePool', storageConfigservice,
             TheElements=theElements)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Delete Volume: %(volumeName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -119,10 +119,10 @@ class EMCVMAXProvisionV3(object):
                   {'volumename': volumeName,
                    'rc': rc})
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Volume: %(volumeName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s.")
@@ -222,10 +222,10 @@ class EMCVMAXProvisionV3(object):
                 SourceElement=sourceInstance.path,
                 TargetElement=targetInstance.path)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error Create Cloned Volume: %(cloneName)s "
                     "Return code: %(rc)lu. Error: %(error)s.")
@@ -292,10 +292,10 @@ class EMCVMAXProvisionV3(object):
             EMCSLO=slo,
             EMCWorkload=workload)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 LOG.error(_LE(
                     "Error Create Group: %(groupName)s. "
                     "Return code: %(rc)lu.  Error: %(error)s."),
@@ -379,10 +379,10 @@ class EMCVMAXProvisionV3(object):
             ElementType=self.utils.get_num(3, '16'),
             Goal=storagePoolSettingInstanceName)
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(
                 conn, supportedSizeDict, extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Cannot get supported size range for %(sps)s "
                     "Return code: %(rc)lu. Error: %(error)s.")
@@ -507,10 +507,10 @@ class EMCVMAXProvisionV3(object):
                   "operation: %(operation)s  Return code: %(rc)lu.",
                   {'sv': syncInstanceName, 'operation': operation, 'rc': rc})
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMessage = (_(
                     "Error modify replica synchronization: %(sv)s "
                     "operation: %(operation)s. "
@@ -564,10 +564,10 @@ class EMCVMAXProvisionV3(object):
             TargetGroup=tgtGroupInstanceName,
             SyncType=self.utils.get_num(syncType, '16'))
 
-        if rc != 0L:
+        if rc != 0:
             rc, errordesc = self.utils.wait_for_job_complete(conn, job,
                                                              extraSpecs)
-            if rc != 0L:
+            if rc != 0:
                 exceptionMsg = (_("Error CreateGroupReplica: "
                                   "source: %(source)s target: %(target)s. "
                                   "Return code: %(rc)lu. Error: %(error)s.")
index 29c26f5540ab695f80ddf1391c42073ee9a157ed..47a3074a7efff4a9d6931dd07f0c892bc7444534 100644 (file)
@@ -376,13 +376,13 @@ class EMCVMAXUtils(object):
                                        LocalOnly=False)
         jobstate = jobinstance['JobState']
         # From ValueMap of JobState in CIM_ConcreteJob
-        # 2L=New, 3L=Starting, 4L=Running, 32767L=Queue Pending
+        # 2=New, 3=Starting, 4=Running, 32767=Queue Pending
         # ValueMap("2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13..32767,
         # 32768..65535"),
         # Values("New, Starting, Running, Suspended, Shutting Down,
         # Completed, Terminated, Killed, Exception, Service,
         # Query Pending, DMTF Reserved, Vendor Reserved")]
-        if jobstate in [2L, 3L, 4L, 32767L]:
+        if jobstate in [2, 3, 4, 32767]:
             return False
         else:
             return True
index 15d6661c7d330d126ffc708f55ea9bcf4d633a7d..e22c07a600f1ca396923adbc838602bf831eeec0 100644 (file)
@@ -177,10 +177,11 @@ class HP3PARCommon(object):
         2.0.42 - Fix type for snapshot config settings. bug #1461640
         2.0.43 - Report the capability of supporting multiattach
         2.0.44 - Update help strings to reduce the 3PAR user role requirements
+        2.0.45 - Python 3 fixes
 
     """
 
-    VERSION = "2.0.44"
+    VERSION = "2.0.45"
 
     stats = {}
 
@@ -579,7 +580,7 @@ class HP3PARCommon(object):
 
         # because 3PAR volume sizes are in
         # Mebibytes, Gigibytes, not Megabytes.
-        MB = 1000L
+        MB = 1000
         MiB = 1.048576
 
         if int(vol_size) == 0: