Merge "Add RBAC scope and new defaults setting support for placement"

This commit is contained in:
Zuul 2022-12-14 10:15:01 +00:00 committed by Gerrit Code Review
commit 1ddae48da3
2 changed files with 14 additions and 0 deletions

View File

@ -48,6 +48,12 @@ fi
PLACEMENT_SERVICE_PROTOCOL=${PLACEMENT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
PLACEMENT_SERVICE_HOST=${PLACEMENT_SERVICE_HOST:-$SERVICE_HOST}
# Flag to set the oslo_policy.enforce_scope and oslo_policy.enforce_new_defaults.
# This is used to switch the Placement API policies scope and new defaults.
# By Default, these flag are False.
# For more detail: https://docs.openstack.org/oslo.policy/latest/configuration/index.html#oslo_policy.enforce_scope
PLACEMENT_ENFORCE_SCOPE=$(trueorfalse False PLACEMENT_ENFORCE_SCOPE)
# Functions
# ---------
@ -111,6 +117,10 @@ function configure_placement {
else
_config_placement_apache_wsgi
fi
if [[ "$PLACEMENT_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults True
iniset $PLACEMENT_CONF oslo_policy enforce_scope True
fi
}
# create_placement_accounts() - Set up required placement accounts

View File

@ -678,6 +678,10 @@ function configure_tempest {
iniset $TEMPEST_CONFIG enforce_scope nova true
fi
if [[ "$PLACEMENT_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
iniset $TEMPEST_CONFIG enforce_scope placement true
fi
if [[ "$GLANCE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
iniset $TEMPEST_CONFIG enforce_scope glance true
fi