Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildcontext/fallback #1070

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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