Skip to content

Commit

Permalink
Process new online_service_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnavarro committed Apr 18, 2023
1 parent c0300c5 commit 3be4c3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v2.2.0 20230187 JP
- Process new online_service_resources

v2.1.2 20230217 JP
- Newer Operations_Warehouse_Django changes DJANGO_CONF to APP_CONFIG

Expand Down
14 changes: 8 additions & 6 deletions bin/router_cider.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def Analyze_Info(self, info_json):
self.logger.info('ID={}, ResourceID={}, Level="{}", Description="{}"'.format(id, p_res['info_resourceid'], p_res['provider_level'], p_res['resource_descriptive_name']))

self.sub = {} # Sub-resource attributes go here
for subtype in ['compute_resources', 'storage_resources', 'grid_resources', 'other_resources']:
for subtype in ['compute_resources', 'storage_resources', 'grid_resources', 'other_resources', 'online_service_resources']:
if subtype in p_res:
self.sub[subtype]=p_res[subtype]

Expand Down Expand Up @@ -328,15 +328,17 @@ def Read_Cache(self, file):
sys.exit(1)

def Warehouse_Info(self, info_json):
id_lookup = {'compute_resources': 'compute_resource_id',
id_lookup = {'compute_resources': 'compute_resource_id',
'other_resources': 'other_resource_id',
'grid_resources': 'grid_resource_id',
'storage_resources': 'storage_resource_id',
'online_service_resources': 'online_service_resource_id',
}
type_lookup = {'compute_resources': 'compute',
'other_resources': 'other',
'grid_resources': 'grid',
'storage_resources': 'storage',
'other_resources': 'other',
'grid_resources': 'grid',
'storage_resources': 'storage',
'online_service_resources': 'online_service',
}

self.cur = {} # Resources currently in database
Expand All @@ -361,7 +363,7 @@ def Warehouse_Info(self, info_json):
# Attributes that don't have their own model field get put in the other_attributes field
other_attributes=p_res.copy()
self.sub = {} # Sub-resource attributes go here
for subtype in ['compute_resources', 'storage_resources', 'grid_resources', 'other_resources']:
for subtype in ['compute_resources', 'storage_resources', 'grid_resources', 'other_resources', 'online_service_resources']:
if subtype in p_res:
self.sub[subtype]=p_res[subtype]
other_attributes.pop(subtype, None)
Expand Down

0 comments on commit 3be4c3a

Please sign in to comment.