From 644954656a6b372523145eecc891058b22b6a291 Mon Sep 17 00:00:00 2001 From: "Mitch Harding (the weird one)" Date: Fri, 5 Apr 2024 17:56:36 -0400 Subject: [PATCH] CASMCMS-8962: Properly handle response from DB.get_all (cherry picked from commit caa5a7663b81d74eb4caa389e8701c411f58a8c7) --- CHANGELOG.md | 2 ++ src/server/cray/cfs/api/controllers/components.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acc9bc5..d0242ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Fix bug in `patch_v2_components_dict` to properly handle response from `DB.get_all()` ## [1.18.2] - 04/04/2024 ### Fixed diff --git a/src/server/cray/cfs/api/controllers/components.py b/src/server/cray/cfs/api/controllers/components.py index bc27d87..8685f2a 100644 --- a/src/server/cray/cfs/api/controllers/components.py +++ b/src/server/cray/cfs/api/controllers/components.py @@ -1,7 +1,7 @@ # # MIT License # -# (C) Copyright 2020-2023 Hewlett Packard Enterprise Development LP +# (C) Copyright 2020-2024 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -302,7 +302,7 @@ def patch_v2_components_dict(data): else: # On large scale systems, this response may be too large # use v3 for smaller responses - components = DB.get_all() + components = [ (component_data["id"], component_data) for component_data in DB.get_all()[0] ] response = [] patch = data.get("patch", {})