Merge "Stop logging unnecessary warning on context create"

This commit is contained in:
Jenkins
2013-11-28 12:44:06 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 6 deletions

View File

@@ -80,8 +80,8 @@ class ContextBase(common_context.RequestContext):
# Log only once the context has been configured to prevent
# format errors.
if kwargs:
LOG.warn(_('Arguments dropped when creating '
'context: %s'), kwargs)
LOG.debug(_('Arguments dropped when creating '
'context: %s'), kwargs)
@property
def project_id(self):

View File

@@ -43,10 +43,10 @@ class TestNeutronContext(base.BaseTestCase):
self.assertIsNone(ctx.user_name)
self.assertIsNone(ctx.tenant_name)
def test_neutron_context_create_logs_unknown_kwargs(self):
with mock.patch.object(context.LOG, 'warn') as mock_warn:
context.Context('user_id', 'tenant_id', foo='bar')
self.assertEqual(mock_warn.call_count, 1)
def test_neutron_context_create_logs_unknown_kwarg(self):
with mock.patch.object(context.LOG, 'debug') as mock_log:
context.Context('user_id', 'tenant_id', foo=None)
self.assertEqual(mock_log.call_count, 1)
def test_neutron_context_create_with_name(self):
ctx = context.Context('user_id', 'tenant_id',