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 <enzo.candotti@windriver.com>
Change-Id: I68bdcfbc9f699d4c1f807500f1826560fb0c1eb9
This commit is contained in:
Enzo Candotti 2024-03-01 14:37:12 -03:00
parent 95e690315e
commit ceec0af760
1 changed files with 2 additions and 2 deletions

View File

@ -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):