components/openstack/neutron/patches/06-launchpad-1255441.patch
changeset 3998 5bd484384122
parent 3997 0ca3f3d6c919
child 4002 95b8f35fcdd5
equal deleted inserted replaced
3997:0ca3f3d6c919 3998:5bd484384122
     1 Although the following patch has been addressed in Icehouse 2014.1, it
       
     2 still has not yet been released for Havana.  It has been modified to
       
     3 apply cleanly into our current Havana implementation
       
     4 
       
     5 commit 5b61df1f539d78cf9d164a142d731e471aa18d4e
       
     6 Author: Maru Newby <[email protected]>
       
     7 Date:   Wed Nov 27 07:57:48 2013 +0000
       
     8 
       
     9     Stop logging unnecessary warning on context create
       
    10     
       
    11     The context was previously logging at the 'warn' level when unknown
       
    12     kwargs were being passed to its __init__().  Since the agents were
       
    13     passing tenant=None with each rpc request, this was generating an
       
    14     unreasonable amount of log chatter that would not be useful to an
       
    15     operator.  The fix is to log at the debug level instead so that
       
    16     the operators don't see the output by default but developers can
       
    17     still choose to.
       
    18     
       
    19     Change-Id: I5c328f628c597eb949c1fe67b23120d2b5d1c7da
       
    20     Related-Bug: #1254530
       
    21     Partial-Bug: #1255441
       
    22 
       
    23 --- neutron-2013.2.3/neutron/context.py.~1~	2014-04-03 11:49:01.000000000 -0700
       
    24 +++ neutron-2013.2.3/neutron/context.py	2014-06-08 12:01:16.420520735 -0700
       
    25 @@ -46,8 +46,8 @@
       
    26              *only* deleted records are visible.
       
    27          """
       
    28          if kwargs:
       
    29 -            LOG.warn(_('Arguments dropped when creating '
       
    30 -                       'context: %s'), kwargs)
       
    31 +            LOG.debug(_('Arguments dropped when creating '
       
    32 +                        'context: %s'), kwargs)
       
    33          super(ContextBase, self).__init__(user=user_id, tenant=tenant_id,
       
    34                                            is_admin=is_admin)
       
    35          self.read_deleted = read_deleted
       
    36 --- neutron-2013.2.3/neutron/tests/unit/test_neutron_context.py.~1~	2014-04-03 11:49:01.000000000 -0700
       
    37 +++ neutron-2013.2.3/neutron/tests/unit/test_neutron_context.py	2014-06-08 12:10:04.483779074 -0700
       
    38 @@ -35,6 +35,11 @@
       
    39          self.assertEqual('user_id', cxt.user_id)
       
    40          self.assertEqual('tenant_id', cxt.project_id)
       
    41  
       
    42 +    def test_neutron_context_create_logs_unknown_kwarg(self):
       
    43 +        with mock.patch.object(context.LOG, 'debug') as mock_log:
       
    44 +            context.Context('user_id', 'tenant_id', foo=None)
       
    45 +        self.assertEqual(mock_log.call_count, 1)
       
    46 +
       
    47      def test_neutron_context_to_dict(self):
       
    48          cxt = context.Context('user_id', 'tenant_id')
       
    49          cxt_dict = cxt.to_dict()