Browse Source

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
changes/17/707317/1
manchandavishal 1 week ago
parent
commit
90de7126e3
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      muranodashboard/packages/views.py
  2. +1
    -1
      muranodashboard/tests/unit/packages/test_views.py

+ 1
- 1
muranodashboard/packages/views.py View File

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

+ 1
- 1
muranodashboard/tests/unit/packages/test_views.py View File

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

Loading…
Cancel
Save