Skip to content
Open
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
15 changes: 14 additions & 1 deletion asu/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,25 @@ def reload_profiles(app: FastAPI, version: str, target: str) -> bool:
settings.upstream_url + f"/{version_path}/targets/{target}/profiles.json"
)

app.profiles[version][target] = {
profiles = {
name.replace(",", "_"): profile
for profile, data in response.json()["profiles"].items()
for name in data.get("supported_devices", []) + [profile]
}

# Eliminate any remapping to alternate supported profiles. Must happen
# /after/ all of above to avoid order-of-listing problems. Also log an
# error message about the improperly defined profiles, as this indicates
# a bug in the Device definitions.
for profile in response.json()["profiles"]:
if profiles[profile] != profile:
# Here's what we should log, but we don't have a good "log once"
# mechanism yet, and don't want to flood the logs.
# f"ERROR: profile bug {version} {target} {profile} mapped to {profiles[profile]}"
profiles[profile] = profile

app.profiles[version][target] = profiles

return True


Expand Down
Loading