Skip to content

Commit

Permalink
chore: modify addtional info key name
Browse files Browse the repository at this point in the history
Signed-off-by: ImMin5 <[email protected]>
  • Loading branch information
ImMin5 committed Oct 21, 2023
1 parent 20071a8 commit fc55a15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ def begin_create_operation(self, scope, parameters):
response = self.cost_mgmt_client.generate_cost_details_report.begin_create_operation(scope=scope,
parameters=parameters,
content_type=content_type)

result = self.convert_nested_dictionary(response.result())
blobs = result.get('blobs', [])
_LOGGER.info(f'[begin_create_operation] result : {result} status : {response.status()}')

blobs = result.get('blobs', []) or []
_LOGGER.debug(f'[begin_create_operation] csv_file_link: {blobs}')
return blobs

Expand Down
6 changes: 3 additions & 3 deletions src/cloudforet/cost_analysis/manager/cost_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def _get_additional_info(self, result, options, tenant_id=None):
meter_category = result.get('metercategory', '')
tenant_id = result.get('customertenantid') if result.get('customertenantid') else tenant_id

additional_info['Tenant ID'] = tenant_id
additional_info['Subscription ID'] = result.get('subscriptionid', 'Shared')
additional_info['Tenant Id'] = tenant_id
additional_info['Subscription Id'] = result.get('subscriptionid', 'Shared')

if meter_category == 'Virtual Machines' and 'Meter' in result:
additional_info['Instance Type'] = result['meter']
Expand Down Expand Up @@ -142,7 +142,7 @@ def _get_additional_info(self, result, options, tenant_id=None):

collect_resource_id = options.get('collect_resource_id', False)
if collect_resource_id and result.get('resourceid') != '' and result.get('resourceid'):
additional_info['Resource ID'] = result['resourceid']
additional_info['Resource Id'] = result['resourceid']
additional_info['Resource Name'] = result['resourceid'].split('/')[-1]

if result.get('productname'):
Expand Down

0 comments on commit fc55a15

Please sign in to comment.