diff --git a/cinder/exception.py b/cinder/exception.py index 8aa1c97417e..6e3bc412ac2 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -1178,7 +1178,7 @@ class BadHTTPResponseStatus(VolumeDriverException): class BadResetResourceStatus(CinderException): - message = _("Bad reset resource status : %(message)s") + message = _("Bad reset resource status : %(reason)s") # ZADARA STORAGE VPSA driver exception @@ -1285,7 +1285,7 @@ class NotSupportedOperation(Invalid): # NexentaStor driver exception class NexentaException(VolumeDriverException): - message = "%(message)s" + message = "%(reason)s" # Google Cloud Storage(GCS) backup driver diff --git a/cinder/tests/unit/volume/drivers/nexenta/test_nexenta.py b/cinder/tests/unit/volume/drivers/nexenta/test_nexenta.py index 3b805d4122a..a048a2c6e20 100644 --- a/cinder/tests/unit/volume/drivers/nexenta/test_nexenta.py +++ b/cinder/tests/unit/volume/drivers/nexenta/test_nexenta.py @@ -480,7 +480,8 @@ class TestNexentaNfsDriver(test.TestCase): mock_chmod.assert_called_with( 'chmod ugo+rw /volumes/stack/share/volume-1/volume') mock_truncate = self.nms_mock.appliance.execute - mock_truncate.side_effect = exception.NexentaException() + mock_truncate.side_effect = exception.NexentaException( + 'fake_exception') self.nms_mock.server.get_prop.return_value = '/volumes' self.nms_mock.folder.get_child_props.return_value = { 'available': 1, 'used': 1} diff --git a/cinder/tests/unit/volume/drivers/nexenta/test_nexenta5_iscsi.py b/cinder/tests/unit/volume/drivers/nexenta/test_nexenta5_iscsi.py index 30745544e4f..a94e7f0bac7 100644 --- a/cinder/tests/unit/volume/drivers/nexenta/test_nexenta5_iscsi.py +++ b/cinder/tests/unit/volume/drivers/nexenta/test_nexenta5_iscsi.py @@ -118,7 +118,8 @@ class TestNexentaISCSIDriver(test.TestCase): self.assertRaises( exception.NexentaException, self.drv.check_for_setup_error) - self.nef_mock.get.side_effect = exception.NexentaException() + self.nef_mock.get.side_effect = exception.NexentaException( + 'fake_exception') self.assertRaises(LookupError, self.drv.check_for_setup_error) def test_create_volume(self): @@ -169,8 +170,8 @@ class TestNexentaISCSIDriver(test.TestCase): self._create_volume_db_entry() vol = self.TEST_VOLUME_REF2 src_vref = self.TEST_VOLUME_REF - crt_vol.side_effect = exception.NexentaException() - dlt_snap.side_effect = exception.NexentaException() + crt_vol.side_effect = exception.NexentaException('fake_exception') + dlt_snap.side_effect = exception.NexentaException('fake_exception') self.assertRaises( exception.NexentaException, self.drv.create_cloned_volume, vol, src_vref) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index e8a8952cb86..eff70bec100 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -1018,7 +1018,7 @@ class VolumeManager(manager.CleanableManager, msg = _("Revert finished, but failed to reset " "volume %(id)s status to %(status)s, " "please manually reset it.") % msg_args - raise exception.BadResetResourceStatus(message=msg) + raise exception.BadResetResourceStatus(reason=msg) s_res = snapshot.update_single_status_where( fields.SnapshotStatus.AVAILABLE, @@ -1030,7 +1030,7 @@ class VolumeManager(manager.CleanableManager, msg = _("Revert finished, but failed to reset " "snapshot %(id)s status to %(status)s, " "please manually reset it.") % msg_args - raise exception.BadResetResourceStatus(message=msg) + raise exception.BadResetResourceStatus(reason=msg) if backup_snapshot: self.delete_snapshot(context, backup_snapshot, handle_quota=False)