Default policy file incorrect in sample config file

Bug #1807071 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Brian Rosmaita

Bug Description

Following changes Ie3ff068e61ea8e0e8fff78deb732e183e036a10c and I997109d6bd1adbcbf72c056f78f1e01547d0fcbd, the default policy file for Cinder is "policy.yaml", and that is in fact what the code looks for. The generated config file, however, is still showing the default of "policy.json", which is the default for oslo.policy, but is *not* the default for Cinder. The reason for this is that the config generator doesn't know that when Cinder is actually executing, it's changing the default using the appropriate oslo API.

Oslo config has a provision to handle this situation, and in fact Cinder is already using it to change the default settings for the CORS middleware:
https://docs.openstack.org/oslo.config/latest/cli/generator.html#modifying-defaults-from-other-namespaces

A similar change needs to be made for the oslo_policy/policy_file setting.

Changed in cinder:
assignee: nobody → Brian Rosmaita (brian-rosmaita)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/623126

Changed in cinder:
status: New → In Progress
Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

Looks like this may have exposed an oslo.policy bug: https://bugs.launchpad.net/oslo.policy/+bug/1807184

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

The downside of this being an oslo.policy bug is that it won't be backportable to any of the stable branches without a library change, which I imagine is unlikely to be approved.

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

oslo.policy 1.44.1, released on 14 Jan 2019, contains the fix my patch needs. The patch has been revised to update cinder's requirements.txt and lower-constraints.txt to use 1.44.1 or greater.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/623126
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=8c132193923168150fdc7f62a20e2d887cde723b
Submitter: Zuul
Branch: master

commit 8c132193923168150fdc7f62a20e2d887cde723b
Author: Brian Rosmaita <email address hidden>
Date: Wed Dec 5 22:12:13 2018 -0500

    Correct default policy_file in the sample config

    When the sample config is generated, the policy_file default value
    specified by oslo.policy is showing up, not the default value that
    Cinder is using. Correct this by enhancing the function specified
    for cinder in the oslo.config.opts.defaults entry point.

    This patch exposed Bug #1807184 in oslo.policy. The requirements
    and lower-constraints changes on this patch bump the minimum
    version of oslo.policy we use to include the fix (1.44.1). This
    version was already included in upper-constraints by Change
    I50bb9d48106376f5baaafae372492c0744182da2.

    Change-Id: Ic28d660a9d876139f47f98cf1024a30b005cd0e0
    Closes-bug: #1807071

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 14.0.0.0rc1

This issue was fixed in the openstack/cinder 14.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.