Skip to content

Commit

Permalink
See CHANGELOG tag-1.0-20210302
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnavarro committed Mar 3, 2021
1 parent 4c47308 commit 404dbcc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
tag-1.0-20210302 JP
- Add User Guide URL and Organization URLs to the Description
- Place public_url in LocalURL if available for both base and sub-resources

tag-1.0-20210224 JP
- Filter out inactive RDR resources, related base resources, and unreferenced organizations (XCI-831)

Expand Down
26 changes: 19 additions & 7 deletions bin/route_resource_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def append(self, value):
else:
self.value += '\n{}'.format(clean_value)
def blank_line(self): # Forced blank line used to start a markup list
self.value += '\n'
if self.value: # If we have a value
self.value += '\n'
def html(self, ID=None): # If an ID is provided, log it to record what resource had the warnings
if self.value is None:
return(None)
Expand Down Expand Up @@ -473,13 +474,13 @@ def Is_Active_RDR(self, allresources, organization=None, resource=None):
#
def Identity_RDRACTIVE(self, allresources):
active_status_set = set(['friendly', 'coming soon', 'pre-production', 'production', 'post-production'])
exclude_resourceid_set = set(['stand-alone.tg.teragrid.org', 'futuregrid0.futuregrid.xsede.org', 'Abe-QB-Grid.teragrid.org'])
excluded_resourceid_set = set(['stand-alone.tg.teragrid.org', 'futuregrid0.futuregrid.xsede.org', 'Abe-QB-Grid.teragrid.org'])
self.RDRACTIVEORGANIZATIONS = {} # Keyed by organization_id
self.RDRACTIVERESOURCES = {} # Keyed by info_resourceid
for baseresource in allresources:
if baseresource['project_affiliation'] != 'XSEDE' or \
baseresource['xsede_services_only'] or \
baseresource['info_resourceid'] in exclude_resourceid_set or \
baseresource['info_resourceid'] in excluded_resourceid_set or \
not list(set(baseresource['current_statuses']) & active_status_set): # This finds the intersection
continue
for subtype in ['compute_resources', 'storage_resources']:
Expand Down Expand Up @@ -1597,7 +1598,9 @@ def Write_RDR_BaseResources(self, content, contype, config):
supportURN = self.SUPPORTPROVIDER_URNMAP.get('helpdesk.xsede.org', None)
if supportURN:
myNEWRELATIONS[supportURN] = 'Supported By'


LocalURL = item.get('public_url', (localUrlPrefix + str(item['resource_id'])) )

# --------------------------------------------
# update ResourceV3 (local) table
try:
Expand All @@ -1608,7 +1611,7 @@ def Write_RDR_BaseResources(self, content, contype, config):
Affiliation = self.Affiliation,
LocalID = str(item['resource_id']),
LocalType = 'base-resource',
LocalURL = localUrlPrefix + str(item['resource_id']),
LocalURL = LocalURL,
CatalogMetaURL = self.CATALOGURN_to_URL(config['CATALOGURN']),
EntityJSON = item,
)
Expand All @@ -1631,7 +1634,7 @@ def Write_RDR_BaseResources(self, content, contype, config):
qualityLevel = 'Production'
elif 'pre-production' in item['current_statuses']:
qualityLevel = 'Testing'
else: # should not be here if currentStatueses is correct
else: # should not be here if currentStatuses is correct
qualityLevel = 'Retired'

# For Keywords, get comma seperated org-abbrev for multiple orgs.
Expand Down Expand Up @@ -1753,7 +1756,10 @@ def Write_RDR_SubResources(self, content, contype, config):
# Support multiple organiztion cases for relation table update,but set
# only the first organization for ProviderID of standard table
myProviderID = None
org_urls = [] # Save to include in Description
for orgs in item['organizations']:
if orgs.get('organization_url'):
org_urls.append(orgs['organization_url'])
orgURN = self.RDRPROVIDER_URNMAP.get(orgs.get('organization_id', ''), None)
if orgURN:
# save only the first provider
Expand All @@ -1771,6 +1777,7 @@ def Write_RDR_SubResources(self, content, contype, config):
if supportURN:
myNEWRELATIONS[supportURN] = 'Supported By'

LocalURL = item.get('public_url', (localUrlPrefix + subID) )

# --------------------------------------------
# update ResourceV3 (local) table
Expand All @@ -1782,7 +1789,7 @@ def Write_RDR_SubResources(self, content, contype, config):
Affiliation = self.Affiliation,
LocalID = subID,
LocalType = localType,
LocalURL = localUrlPrefix + subID,
LocalURL = LocalURL,
CatalogMetaURL = self.CATALOGURN_to_URL(config['CATALOGURN']),
EntityJSON = sub,
)
Expand Down Expand Up @@ -1824,6 +1831,11 @@ def Write_RDR_SubResources(self, content, contype, config):
# For ShortDescription
ShortDescription = '{} ({}) provided by the {}'.format(sub['resource_descriptive_name'], sub['info_resourceid'], orgNames)
Description = Format_Description(sub.get('resource_description'))
Description.blank_line()
if sub.get('user_guide_url'):
Description.append('- User Guide URL: {}'.format(sub.get('user_guide_url')))
for url in org_urls:
Description.append('- Organization web site: {}'.format(url))
try:
resource = ResourceV3(
ID = myGLOBALURN,
Expand Down

0 comments on commit 404dbcc

Please sign in to comment.