Skip to content

Commit

Permalink
fix: fix issue with collecting resource group data
Browse files Browse the repository at this point in the history
Signed-off-by: ImMin5 <[email protected]>
  • Loading branch information
ImMin5 committed Oct 19, 2023
1 parent 302d9dc commit c1b2998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cloudforet/cost_analysis/conf/cost_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'global': 'Global',
'unknown': 'Unknown',
'unassigned': 'Unassigned',
'all regions': 'All Regions',
'intercontinental': 'Intercontinental',
'ap east': 'eastasia',
'ca central': 'canadacentral',
Expand Down
4 changes: 3 additions & 1 deletion src/cloudforet/cost_analysis/manager/cost_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ def _get_additional_info(self, result, options, tenant_id=None):
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['Subscription ID'] = result.get('subscriptionid', 'Shared')

if meter_category == 'Virtual Machines' and 'Meter' in result:
additional_info['Instance Type'] = result['meter']

if result.get('resourcegroupname') != '' and result.get('resourcegroupname'):
additional_info['Resource Group'] = result['resourcegroupname']
elif result.get('resourcegroup') != '' and result.get('resourcegroup'):
additional_info['Resource Group'] = result['resourcegroup']

if result.get('resourcetype') != '' and result.get('resourcetype'):
additional_info['Resource Type'] = result['resourcetype']
Expand Down

0 comments on commit c1b2998

Please sign in to comment.