When a patch installation is triggered on a locked host via Horizon,
it crashes redirecting to an error screen. The normal behaviour seen
using the CLI is just an error message saying that the host is unknown
because of being locked.
Horizon should show this error message instead of crashing. The root
cause is an issue during raising the ValueError expection, because
of an 'AttributeError' exception raised on the 'split_message'
function.
This commit fixes this problem by replacing the ValueError exception
with the Horizon error message function.
Closes-Bug: 2040495
Test Plan:
PASS: Build the starlingx-dashboard package, install it on a
system and verify the changes are applied correctly.
PASS: Execute test scenarios to receive errors in various
requests impacted by this function. Verify that the error message
is correctly displayed and logged.
Reviewed: https:/ /review. opendev. org/c/starlingx /gui/+/ 899996 /opendev. org/starlingx/ gui/commit/ 7e8845bf25bb079 fa7db06fe432759 d302a2a61b
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 7e8845bf25bb079 fa7db06fe432759 d302a2a61b
Author: Enzo Candotti <email address hidden>
Date: Thu Nov 2 22:36:32 2023 -0300
Fix Horizon crash on a patch installation
When a patch installation is triggered on a locked host via Horizon,
it crashes redirecting to an error screen. The normal behaviour seen
using the CLI is just an error message saying that the host is unknown
because of being locked.
Horizon should show this error message instead of crashing. The root
cause is an issue during raising the ValueError expection, because
of an 'AttributeError' exception raised on the 'split_message'
function.
This commit fixes this problem by replacing the ValueError exception
with the Horizon error message function.
Closes-Bug: 2040495
Test Plan:
PASS: Build the starlingx-dashboard package, install it on a
system and verify the changes are applied correctly.
PASS: Execute test scenarios to receive errors in various
requests impacted by this function. Verify that the error message
is correctly displayed and logged.
Signed-off-by: Enzo Candotti <email address hidden> abc632a81612013 02cd9a51681
Change-Id: Ia8cdce0b89be30