Follow up changes to granular placement policy reviews

This is just a consolidated patch for minor issues found
during the granular placement policy series.

Part of blueprint granular-placement-policy

Change-Id: I8f5d3ed143aa88bacf9e9f39df224b314688b412
This commit is contained in:
Matt Riedemann
2018-05-25 11:29:47 -04:00
parent 8ac77b05c3
commit e12968c331
2 changed files with 4 additions and 2 deletions

View File

@@ -36,8 +36,8 @@ class RequestContext(context.RequestContext):
{'project_id': self.project_id, 'user_id': self.user_id}
:param fatal: if False, will return False when an
exception.PolicyNotAuthorized occurs.
:raises nova.exception.PolicyNotAuthorized: if verification fails and
fatal is True.
:raises nova.api.openstack.placement.exception.PolicyNotAuthorized:
if verification fails and fatal is True.
:return: returns a non-False value (not necessarily "True") if
authorized and False if not authorized and fatal is False.
"""

View File

@@ -52,6 +52,8 @@ def get_enforcer():
# This method is used by oslopolicy CLI scripts in order to generate policy
# files from overrides on disk and defaults in code. We can just pass an
# empty list and let oslo do the config lifting for us.
# TODO(mriedem): Change the project kwarg value to "placement" once
# this code is extracted from nova.
cfg.CONF([], project='nova')
init()
return _ENFORCER_PLACEMENT