Merge "NetApp: Log unexpected errors from backend"
This commit is contained in:
commit
0d2e9cc00d
@ -214,7 +214,7 @@ class NetAppApiServerTests(test.TestCase):
|
||||
na_element = zapi_fakes.FAKE_NA_ELEMENT
|
||||
self.mock_object(self.root, '_create_request', mock.Mock(
|
||||
return_value=('abc', zapi_fakes.FAKE_NA_ELEMENT)))
|
||||
self.mock_object(netapp_api, 'LOG')
|
||||
mock_log = self.mock_object(netapp_api, 'LOG')
|
||||
self.root._opener = zapi_fakes.FAKE_HTTP_OPENER
|
||||
self.mock_object(self.root, '_build_opener')
|
||||
self.mock_object(self.root._opener, 'open', mock.Mock(
|
||||
@ -222,6 +222,7 @@ class NetAppApiServerTests(test.TestCase):
|
||||
|
||||
self.assertRaises(netapp_api.NaApiError, self.root.send_http_request,
|
||||
na_element)
|
||||
self.assertEqual(1, mock_log.exception.call_count)
|
||||
|
||||
def test_send_http_request_valid(self):
|
||||
"""Tests the method send_http_request with valid parameters"""
|
||||
|
@ -32,7 +32,7 @@ import six
|
||||
from six.moves import urllib
|
||||
|
||||
from cinder import exception
|
||||
from cinder.i18n import _
|
||||
from cinder.i18n import _, _LE
|
||||
from cinder import ssh_utils
|
||||
from cinder import utils
|
||||
|
||||
@ -224,6 +224,7 @@ class NaServer(object):
|
||||
except urllib.error.HTTPError as e:
|
||||
raise NaApiError(e.code, e.msg)
|
||||
except Exception:
|
||||
LOG.exception(_LE("Error communicating with NetApp filer."))
|
||||
raise NaApiError('Unexpected error')
|
||||
|
||||
response_xml = response.read()
|
||||
|
Loading…
Reference in New Issue
Block a user