Remove unnecessary int casting
This is to do the same cleanup as Ifd4543a7d0373e814584bb936a7150bb68478277, do not use int casting on integer value Change-Id: I382b151e50fde3aaa2310222fe68da7ec8e3581a
This commit is contained in:
parent
a0ef988016
commit
44cdf1566f
|
@ -101,7 +101,7 @@ class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest):
|
|||
# check some extensions for the flavor create/show/detail response
|
||||
self.assertEqual(flavor['swap'], '')
|
||||
self.assertEqual(int(flavor['rxtx_factor']), 1)
|
||||
self.assertEqual(int(flavor['OS-FLV-EXT-DATA:ephemeral']), 0)
|
||||
self.assertEqual(flavor['OS-FLV-EXT-DATA:ephemeral'], 0)
|
||||
self.assertEqual(flavor['os-flavor-access:is_public'], True)
|
||||
|
||||
flavor_name = data_utils.rand_name(self.flavor_name_prefix)
|
||||
|
|
|
@ -66,7 +66,7 @@ class ServersAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||
flavor_id = self._get_unused_flavor_id()
|
||||
quota_set = self.quotas_client.show_quota_set(
|
||||
self.tenant_id)['quota_set']
|
||||
ram = int(quota_set['ram'])
|
||||
ram = quota_set['ram']
|
||||
if ram == -1:
|
||||
raise self.skipException("ram quota set is -1,"
|
||||
" cannot test overlimit")
|
||||
|
@ -94,7 +94,7 @@ class ServersAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||
flavor_id = self._get_unused_flavor_id()
|
||||
quota_set = self.quotas_client.show_quota_set(
|
||||
self.tenant_id)['quota_set']
|
||||
vcpus = int(quota_set['cores'])
|
||||
vcpus = quota_set['cores']
|
||||
if vcpus == -1:
|
||||
raise self.skipException("cores quota set is -1,"
|
||||
" cannot test overlimit")
|
||||
|
|
|
@ -41,11 +41,11 @@ class AbsoluteLimitsNegativeTestJSON(base.BaseV2ComputeTest):
|
|||
max_meta = limits['absolute']['maxImageMeta']
|
||||
|
||||
# No point in running this test if there is no limit.
|
||||
if int(max_meta) == -1:
|
||||
if max_meta == -1:
|
||||
raise self.skipException('no limit for maxImageMeta')
|
||||
|
||||
# Create server should fail, since we are passing > metadata Limit!
|
||||
max_meta_data = int(max_meta) + 1
|
||||
max_meta_data = max_meta + 1
|
||||
|
||||
meta_data = {}
|
||||
for xx in range(max_meta_data):
|
||||
|
|
|
@ -97,7 +97,7 @@ class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
|
|||
max_file_limit = limits['absolute']['maxPersonality']
|
||||
if max_file_limit == -1:
|
||||
raise self.skipException("No limit for personality files")
|
||||
for i in range(0, int(max_file_limit) + 1):
|
||||
for i in range(0, max_file_limit + 1):
|
||||
path = 'etc/test' + str(i) + '.txt'
|
||||
personality.append({'path': path,
|
||||
'contents': base64.encode_as_text(
|
||||
|
@ -117,7 +117,7 @@ class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
|
|||
if max_file_limit == -1:
|
||||
raise self.skipException("No limit for personality files")
|
||||
person = []
|
||||
for i in range(0, int(max_file_limit)):
|
||||
for i in range(0, max_file_limit):
|
||||
# NOTE(andreaf) The cirros disk image is blank before boot
|
||||
# so we can only inject safely to /
|
||||
path = '/test' + str(i) + '.txt'
|
||||
|
|
|
@ -114,7 +114,7 @@ class BaseVolumeQuotasAdminV2TestJSON(base.BaseVolumeAdminTest):
|
|||
volume_default = quota_set_default['volumes']
|
||||
|
||||
self.admin_quotas_client.update_quota_set(
|
||||
project_id, volumes=(int(volume_default) + 5))
|
||||
project_id, volumes=(volume_default + 5))
|
||||
|
||||
self.admin_quotas_client.delete_quota_set(project_id)
|
||||
quota_set_new = (self.admin_quotas_client.show_quota_set(project_id)
|
||||
|
|
Loading…
Reference in New Issue