← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2048198] Re: neutron-lib role enforcer is writing warning messages

 

Reviewed:  https://review.opendev.org/c/openstack/neutron-lib/+/906539
Committed: https://opendev.org/openstack/neutron-lib/commit/f0724e9cf1dd761bd14abfcd8b7e16369387c23a
Submitter: "Zuul (22348)"
Branch:    master

commit f0724e9cf1dd761bd14abfcd8b7e16369387c23a
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date:   Mon Jan 29 00:04:34 2024 +0000

    Skip the enforcer undefined rule check
    
    That will avoid unnecessary warning messages in the logs. The
    role enforcer only loads the following 3 rules:
    * _ADMIN_CTX_POLICY = 'context_is_admin'
    * _ADVSVC_CTX_POLICY = 'context_is_advsvc'
    * _SERVICE_ROLE = 'service_api'
    
    This functionality was implemented in [1]. oslo.policy library
    is bumped to version 4.3.0 that contains this patch.
    
    [1]https://review.opendev.org/c/openstack/oslo.policy/+/907196
    
    Closes-Bug: #2048198
    Change-Id: I1581b95035c4afebf63518b64c35bc0c61c292e9


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2048198

Title:
  neutron-lib role enforcer is writing warning messages

Status in neutron:
  Fix Released

Bug description:
  If any policy rules is defined in the policy file, the neutron-lib role enforcer is writing WARNING log messages. E.g.:
  """
  WARNING oslo_policy.policy [None req-99d94096-bf0c-4898-979c-42da329c27a4 None None] Policies ['get_floatingip'] reference a rule that is not defined.
  """

  This is happening when the policy file rules are loaded. These rules
  could not be in the rule enforcer base rules [2] (currently 3: admin,
  advance service and service role). If that happens, the oslo.policy
  ``Enforcer`` will write the referred WARNING message.

  Although this behavior is harmless, it is needed a way to avoid these
  kind of messages.

  [1]https://github.com/openstack/neutron-lib/blob/9e3a3a608670d2d7bc0ae98fd39551920e563efe/neutron_lib/policy/_engine.py#L62-L66
  [2]https://github.com/openstack/neutron-lib/blob/9e3a3a608670d2d7bc0ae98fd39551920e563efe/neutron_lib/policy/_engine.py#L33-L46

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2048198/+subscriptions



References