<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 7 July 2015 at 11:56, Doug Hellmann <span dir="ltr"><<a href="mailto:doug@doughellmann.com" target="_blank">doug@doughellmann.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Excerpts from Ben Nemec's message of 2015-07-07 11:41:35 -0500:<br>
<div><div>> On 07/04/2015 12:12 AM, Akihiro Motoki wrote:<br>
> > Hi Oslo and Neutron folks,<br>
> ><br>
> > Why is policy_dirs option deprecated in oslo.policy?<br>
> > In Neutron we have multiple repositories which consist of Neutron services<br>
> > and we would like to maintain policy.json separately.<br>
> > policy_dirs option looks useful for this purpose.<br>
> ><br>
> > == Detail ==<br>
> ><br>
> > Neutron project now consists of several repositories and<br>
> > they are imported when neutron-server runs.<br>
> > There are cases where it makes sense that each repository manages its<br>
> > policy.json<br>
> > and the neutron-server wants to load all related policy.json files.<br>
> > - advanced services have separate repositories and they evolve their API<br>
> > independently<br>
> > - vendor plugins/drivers in separate repositories (can) have<br>
> > vendor-specific extension API.<br>
> >   (It is not a good thing from the point of the current API discussion,<br>
> > but we have now.)<br>
> ><br>
> > An easy way is to put all related policy.json into a single directory<br>
> > lile /etc/neutron/policy.d and specify this to policy_dirs option.<br>
><br>
> This will still work fine.  The reason policy_dirs was deprecated is<br>
> that we didn't see a need to allow arbitrary policy.d locations and<br>
> doing so caused issues in some edge cases, so after the opt is removed<br>
> we will simply look for policy.d in the configuration directory.<br>
><br>
> Essentially, today the default would be to look in<br>
> /etc/neutron/policy.d, but you can change that if you want.  Once the<br>
> opt is removed, you will _only_ be able to use /etc/neutron/policy.d.<br>
><br>
> -Ben<br>
><br>
<br>
</div></div>It's more subtle than that. We have 2 variables interacting right<br>
now, config_dirs (managed by oslo.config) and policy_dirs (managed<br>
by oslo.policy). Both represent multiple places to look for<br>
configuration files, but the policy_dirs value must be a subdirectory<br>
of config_dirs.<br>
<br>
So if config_dirs is ['/etc/one', '/etc/two'] and policy_dirs is<br>
['policy.d', 'another.d'] then the valid locations for policy files are<br>
['/etc/one/policy.d', '/etc/two/policy.d', '/etc/one/another.d',<br>
'/etc/two/another.d']. That set of paths is obvious, but the *order* is<br>
also important, and it's not obvious.<br>
<br>
If we really need to have multiple policy files, we should add that<br>
support explicitly somehow instead of backing into it by having<br>
multiple directories.<br></blockquote><div><br></div><div>So long as we keep multiple policy files in a single flat directory (default to /etc/neutron/policy.d), this is enough to load them all of them at once after the config option policy_dirs is removed. Did I understand this correctly?</div><div><br></div><div>Many thanks,</div><div>Armando</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><font color="#888888"><br>
Doug<br>
</font></span><div><div><br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div><div><br></div></blockquote></div></div></div>