Skip to content

Commit

Permalink
feat: remove get region info from AzureManager (cloudforet-io#52)
Browse files Browse the repository at this point in the history
Signed-off-by: ImMin5 <[email protected]>
  • Loading branch information
ImMin5 committed Mar 31, 2023
1 parent 849e59e commit 1ac04b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
25 changes: 12 additions & 13 deletions src/spaceone/inventory/libs/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ def convert_nested_dictionary(self, cloud_svc_object):

return cloud_svc_dict

def match_region_info(self, region_code):
match_region_info = self.region_info.get(region_code)

if match_region_info:
region_info = match_region_info.copy()
region_info.update({
'region_code': region_code
})
return RegionResource(region_info, strict=False)

return None

@staticmethod
def convert_tag_format(tags):
convert_tags = []
Expand All @@ -136,19 +148,6 @@ def convert_tag_format(tags):

return convert_tags

@staticmethod
def match_region_info(region_code):
match_region_info = AzureManager.region_info.get(region_code)

if match_region_info:
region_info = match_region_info.copy()
region_info.update({
'region_code': region_code
})
return RegionResource(region_info, strict=False)

return None

@staticmethod
def convert_dictionary(obj):
return vars(obj)
Expand Down
3 changes: 1 addition & 2 deletions src/spaceone/inventory/service/collector_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ def collect(self, params):
start_time = time.time()
secret_data = params.get('secret_data', {})
params.update({
'subscription_info': self.get_subscription_info(params),
'subscription_info': self.get_subscription_info(params)
})

_LOGGER.debug("[ EXECUTOR START: Azure Cloud Service ]")
AzureManager.region_info = self.list_location_info(params)
target_execute_managers = self._get_target_execute_manger(params.get('options', {}))

# Thread per cloud services
Expand Down

0 comments on commit 1ac04b5

Please sign in to comment.