From ceec0af76092bb524978052e51c3321073425d9b Mon Sep 17 00:00:00 2001 From: Enzo Candotti Date: Fri, 1 Mar 2024 14:37:12 -0300 Subject: [PATCH] Fix Horizon crash on multiple unprovisioned hosts This change fixes a problem that made Horizon to crash when there are more than one unprovisioned host, in the Host Inventory dashboard. Closes-Bug: 2055721 Test Plan: PASS: Deploy a Standard system and add multiple unprovisioned hosts. Verify that the Host Inventory dashboard is displayed correctly. Signed-off-by: Enzo Candotti Change-Id: I68bdcfbc9f699d4c1f807500f1826560fb0c1eb9 --- .../starlingx_dashboard/dashboards/admin/inventory/tabs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py index 3ce1459a..9e4641c8 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2013-2021 Wind River Systems, Inc. +# Copyright (c) 2013-2024 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -116,7 +116,7 @@ class HostsTab(tabs.TableTab): h.allow_insvc_patching = ph.allow_insvc_patching # Sort hosts by hostname - hosts.sort(key=lambda f: (f.hostname)) + hosts.sort(key=lambda f: f.hostname if f.hostname else '') return hosts def get_hostscontroller_data(self):