From 694bd0fbc60cbfff620b3cefdc7327ea5e37f9a1 Mon Sep 17 00:00:00 2001 From: Rafael Moyano Date: Fri, 5 May 2023 16:59:41 -0300 Subject: [PATCH] Horizon orchestration pop-up shows redundant error When you try to create an orchestration Strategy and it failed, the pop-up showed the same error message in the main and details section. This change fixes this issue. In addition, has been fixed for the Apply Strategy action too. Test Plan: PASS: Create an invalid strategy and verify the pop-up error message is displayed properly for example: Error: Strategy creation failed. Details: The server could not comply with the request since its either malformed or otherwise incorrect. Invalid groud_id PASS: Apply strategy and verify the pop-up error message is displayed properly. Closes-bug: 2018625 Change-Id: I805cc051a843af07f2dba1701aef8bc791b9450a Signed-off-by: Rafael Moyano --- .../dashboards/dc_admin/dc_orchestration/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/dc_orchestration/forms.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/dc_orchestration/forms.py index 4e196f30..f020e8dc 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/dc_orchestration/forms.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/dc_orchestration/forms.py @@ -33,7 +33,7 @@ class ApplyCloudStrategyForm(forms.SelfHandlingForm): except Exception as ex: LOG.exception(ex) redirect = reverse(self.failure_url) - msg = _('Strategy apply failed: "%s".') % str(ex) + msg = _('Strategy apply failed.') exceptions.handle(request, msg, redirect=redirect) return True @@ -273,8 +273,9 @@ class CreateCloudStrategyForm(forms.SelfHandlingForm): if not response: messages.error(request, "Strategy creation failed") except Exception as ex: + LOG.exception(ex) redirect = reverse(self.failure_url) - msg = _('Strategy creation failed: "%s".') % str(ex) + msg = _('Strategy creation failed.') exceptions.handle(request, msg, redirect=redirect) return True