Skip to content

Commit

Permalink
Merge pull request #1598 from grycap/devel
Browse files Browse the repository at this point in the history
Return nice error in case of AppDB site:service
  • Loading branch information
micafer authored Jul 23, 2024
2 parents 3fad851 + 1f10a99 commit 3276c5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion IM/AppDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def get_site_id(site_name, stype="occi"):
data = AppDB.appdb_call('/rest/1.0/sites')
if data:
for site in data['appdb:site']:
if site_name.lower() == site['@name'].lower() and site['@infrastructure'] == "Production":
if (site_name.lower() == site['@name'].lower() and
site['@infrastructure'] == "Production" and
'site:service' in site):
if isinstance(site['site:service'], list):
services = site['site:service']
else:
Expand All @@ -68,6 +70,8 @@ def get_site_url(site_id, stype="occi"):
"""
Get the site url from the site ID
"""
if not site_id:
return None
data = AppDB.appdb_call('/rest/1.0/va_providers/%s' % site_id)
site_url = None
if data:
Expand Down

0 comments on commit 3276c5e

Please sign in to comment.