From 90de7126e38376673c4ab4efb5e20bd72cc837ac Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Wed, 12 Feb 2020 06:10:40 +0000 Subject: [PATCH] Revert the original logic in code Change Ibc743a552a43147153dd0ca3a46ab8d977c7ca0d changes the logic[1] in wrong way and for the test[2] as well. This patch corrects the same. [1] https://opendev.org/openstack/murano-dashboard/src/branch/master/muranodashboard/packages/views.py#L419 [2] https://opendev.org/openstack/murano-dashboard/src/branch/master/muranodashboard/tests/unit/packages/test_views.py#L488 Change-Id: I80f3aa160b41554fa319e6ced2edf5a39d366302 --- muranodashboard/packages/views.py | 2 +- muranodashboard/tests/unit/packages/test_views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/muranodashboard/packages/views.py b/muranodashboard/packages/views.py index 371d250ea..c3912be98 100644 --- a/muranodashboard/packages/views.py +++ b/muranodashboard/packages/views.py @@ -416,7 +416,7 @@ class ImportPackageWizard(horizon_views.PageTitleMixin, views.ModalFormMixin, if error: reason = error.get('message') except ValueError: - raise + raise original_e msg = _('Uploading package failed. {0}').format(reason) LOG.exception(msg) exceptions.handle( diff --git a/muranodashboard/tests/unit/packages/test_views.py b/muranodashboard/tests/unit/packages/test_views.py index efaaf4a9b..c7dd9f708 100644 --- a/muranodashboard/tests/unit/packages/test_views.py +++ b/muranodashboard/tests/unit/packages/test_views.py @@ -485,7 +485,7 @@ class TestImportPackageWizard(helpers.APITestCase): mock_json.loads.side_effect = ValueError('test_error_message') original_e = ValueError('original_error_message') setattr(original_e, 'details', 'error_details') - with self.assertRaisesRegex(ValueError, 'test_error_message'): + with self.assertRaisesRegex(ValueError, 'original_error_message'): self.import_pkg_wizard._handle_exception(original_e) @mock.patch.object(views, 'glance')