Skip to content

Commit

Permalink
buildcontext/fallback (spacetelescope#1070)
Browse files Browse the repository at this point in the history
* revert back to v1 zendesk action

* if no cal software installed, default to latest
  • Loading branch information
alphasentaurii committed Sep 25, 2024
1 parent 4eb0ae0 commit 2ce2c6e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions crds/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,18 +351,20 @@ def get_build_context(observatory=None):
calibration pipeline sw is included as a template. If no match found, returns latest
(formerly operational) context.
"""
if observatory == 'jwst':
calver = get_jwst_cal()
else:
cal = dict(roman='romancal', hst='caldp')
try:
try:
if observatory == 'jwst':
calver = get_jwst_cal()
else:
cal = dict(roman='romancal', hst='caldp')
calver = importlib.metadata.version(cal.get(observatory,''))
except importlib.metadata.PackageNotFoundError:
calver = ''
except importlib.metadata.PackageNotFoundError:
calver = ''
log.warning("Cal SW not found, defaulting to latest.")
if calver:
calver = config.simplify_version(calver)
return str(S.get_build_context(observatory, calver))
else:

return get_default_context(observatory=observatory, state='latest')


Expand Down

0 comments on commit 2ce2c6e

Please sign in to comment.