From 7961381e4b22f849906f459f4a40b689e904fbab Mon Sep 17 00:00:00 2001 From: Ryan Bak Date: Fri, 27 Oct 2023 10:29:46 -0400 Subject: [PATCH] Fix component not found error messages --- CHANGELOG.md | 2 +- src/bos/server/controllers/v2/components.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4fd510d..a69aee5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed -- Sessions the specify nodes that aren't in the current tenant will fail +- Sessions that specify nodes that aren't in the current tenant will fail ## [2.10.1] - 2023-10-31 ### Fixed diff --git a/src/bos/server/controllers/v2/components.py b/src/bos/server/controllers/v2/components.py index 7bdb9859..fdfb6535 100644 --- a/src/bos/server/controllers/v2/components.py +++ b/src/bos/server/controllers/v2/components.py @@ -196,7 +196,7 @@ def patch_v2_components_list(data): component_id = component_data['id'] if component_id not in DB or not _is_valid_tenant_component(component_id): return connexion.problem( - status=404, title="Component could not found.", + status=404, title="Component not found.", detail="Component {} could not be found".format(component_id)) components.append((component_id, component_data)) except Exception as err: @@ -251,7 +251,7 @@ def get_v2_component(component_id): LOGGER.debug("GET /components/id invoked get_component") if component_id not in DB or not _is_valid_tenant_component(component_id): return connexion.problem( - status=404, title="Component could not found.", + status=404, title="Component not found.", detail="Component {} could not be found".format(component_id)) component = DB.get(component_id) component = _set_status(component) @@ -281,7 +281,7 @@ def patch_v2_component(component_id): LOGGER.debug("PATCH /components/id invoked patch_component") if component_id not in DB or not _is_valid_tenant_component(component_id): return connexion.problem( - status=404, title="Component could not found.", + status=404, title="Component not found.", detail="Component {} could not be found".format(component_id)) try: data = connexion.request.get_json() @@ -325,7 +325,7 @@ def delete_v2_component(component_id): LOGGER.debug("DELETE /components/id invoked delete_component") if component_id not in DB or not _is_valid_tenant_component(component_id): return connexion.problem( - status=404, title="Component could not found.", + status=404, title="Component not found.", detail="Component {} could not be found".format(component_id)) return DB.delete(component_id), 204