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 <rafael.moyano@windriver.com>
This commit is contained in:
Rafael Moyano 2023-05-05 16:59:41 -03:00 committed by rafael moyano
parent db9bb2cf03
commit 694bd0fbc6
1 changed files with 3 additions and 2 deletions

View File

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