Skip to content

Commit

Permalink
OS-7952. Fixed bug with none cloud_resource_id
Browse files Browse the repository at this point in the history
  • Loading branch information
nk-hystax authored Nov 20, 2024
1 parent 44d1b69 commit 36a68dd
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ def _get(self):
result = []
for sli_id in short_living_instances_map:
resource_hash = None
resource_id = None
resource_exp = short_living_instances_map.get(sli_id, {})
flavor_cost = resource_exp.get('flavor_cost', 0)
other_cost = resource_exp.get('other_cost', 0)
Expand All @@ -199,7 +198,6 @@ def _get(self):
_, resources = self.rest_client.cloud_resource_list(
cloud_account_id, cloud_resource_hash=sli_id)
else:
resource_id = sli_id
_, resources = self.rest_client.cloud_resource_list(
cloud_account_id, cloud_resource_id=sli_id)
resources = resources.get('resources', [])
Expand All @@ -212,7 +210,7 @@ def _get(self):
saving = flavor_cost * SPOT_SAVING_COEFFICIENT
if saving > 0:
result.append({
'cloud_resource_id': resource_id,
'cloud_resource_id': resource.get('cloud_resource_id'),
'cloud_resource_hash': resource_hash,
'resource_name': resource.get('name'),
'resource_id': resource.get('id'),
Expand Down

0 comments on commit 36a68dd

Please sign in to comment.