Merge "Fix the log level in scheduler manage"

This commit is contained in:
Jenkins 2015-08-18 15:18:06 +00:00 committed by Gerrit Code Review
commit 815866b7d2
2 changed files with 5 additions and 3 deletions

View File

@ -27,7 +27,7 @@ from oslo_utils import importutils
from manila import context
from manila import db
from manila import exception
from manila.i18n import _LW
from manila.i18n import _LE
from manila import manager
from manila import rpc
from manila.share import rpcapi as share_rpcapi
@ -96,8 +96,8 @@ class SchedulerManager(manager.Manager):
def _set_share_error_state_and_notify(self, method, context, ex,
request_spec):
LOG.warning(_LW("Failed to schedule_%(method)s: %(ex)s"),
{"method": method, "ex": ex})
LOG.error(_LE("Failed to schedule_%(method)s: %(ex)s"),
{"method": method, "ex": ex})
share_state = {'status': 'error'}
properties = request_spec.get('share_properties', {})

View File

@ -89,6 +89,7 @@ class SchedulerManagerTestCase(test.TestCase):
with mock.patch.object(self.manager.driver,
'schedule_create_share',
mock.Mock(side_effect=raise_no_valid_host)):
self.mock_object(manager.LOG, 'error')
self.manager.create_share(self.context, topic, share_id,
request_spec=request_spec,
filter_properties={})
@ -96,6 +97,7 @@ class SchedulerManagerTestCase(test.TestCase):
self.context, fake_share_id, {'status': 'error'})
self.manager.driver.schedule_create_share.assert_called_once_with(
self.context, request_spec, {})
manager.LOG.error.assert_called_once_with(mock.ANY, mock.ANY)
def test_get_pools(self):
"""Ensure get_pools exists and calls driver.get_pools."""