From db9bb2cf03ba1cff7ed7b0b4739d0383b59d17de Mon Sep 17 00:00:00 2001 From: fperez Date: Tue, 11 Apr 2023 13:33:38 -0300 Subject: [PATCH] Fix improper error message when reducing partition size When attempting to reduce partition size from the GUI, a generic error message is returned. This occurs because providing the complete error details to the error handler can lead to the generation of a distinct exception. Test plan: Install Standard. Create partition and attempt to reduce size from GUI. Verify that error message indicates that is not possible to reduce partitions. Also verify that right error message is present in horizon.log and that any other exception dissapear for this action. Closes-Bug: 2015918 Signed-off-by: fperez Change-Id: I9ad7315f9e428d029b30ea230c343a4fe1df8a5f --- .../dashboards/admin/inventory/storages/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/storages/forms.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/storages/forms.py index eb8f2b2f..2ef405bf 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/storages/forms.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/storages/forms.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2013-2021 Wind River Systems, Inc. +# Copyright (c) 2013-2023 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -678,7 +678,7 @@ class EditPartition(forms.SelfHandlingForm): # No redirect, return to previous storage tab view. # The REST API error message will appear on UI as # "horizon.exceptions.handle" will invoke "messages.error". - return exceptions.handle(request, message=ce) + return exceptions.handle(request, message=msg) except Exception as e: msg = _('Failed to update partition.') LOG.info(msg)