Merge "Stop logging unnecessary warning on context create"
This commit is contained in:
@@ -80,7 +80,7 @@ class ContextBase(common_context.RequestContext):
|
|||||||
# Log only once the context has been configured to prevent
|
# Log only once the context has been configured to prevent
|
||||||
# format errors.
|
# format errors.
|
||||||
if kwargs:
|
if kwargs:
|
||||||
LOG.warn(_('Arguments dropped when creating '
|
LOG.debug(_('Arguments dropped when creating '
|
||||||
'context: %s'), kwargs)
|
'context: %s'), kwargs)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ class TestNeutronContext(base.BaseTestCase):
|
|||||||
self.assertIsNone(ctx.user_name)
|
self.assertIsNone(ctx.user_name)
|
||||||
self.assertIsNone(ctx.tenant_name)
|
self.assertIsNone(ctx.tenant_name)
|
||||||
|
|
||||||
def test_neutron_context_create_logs_unknown_kwargs(self):
|
def test_neutron_context_create_logs_unknown_kwarg(self):
|
||||||
with mock.patch.object(context.LOG, 'warn') as mock_warn:
|
with mock.patch.object(context.LOG, 'debug') as mock_log:
|
||||||
context.Context('user_id', 'tenant_id', foo='bar')
|
context.Context('user_id', 'tenant_id', foo=None)
|
||||||
self.assertEqual(mock_warn.call_count, 1)
|
self.assertEqual(mock_log.call_count, 1)
|
||||||
|
|
||||||
def test_neutron_context_create_with_name(self):
|
def test_neutron_context_create_with_name(self):
|
||||||
ctx = context.Context('user_id', 'tenant_id',
|
ctx = context.Context('user_id', 'tenant_id',
|
||||||
|
|||||||
Reference in New Issue
Block a user