File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ NOVA_SERVICE_LISTEN_ADDRESS=${NOVA_SERVICE_LISTEN_ADDRESS:-$(ipv6_unquote $SERVI
9797METADATA_SERVICE_PORT=${METADATA_SERVICE_PORT:- 8775}
9898NOVA_ENABLE_CACHE=${NOVA_ENABLE_CACHE:- True}
9999
100+ # Flag to set the oslo_policy.enforce_scope and oslo_policy.enforce_new_defaults.
101+ # This is used to switch the compute API policies enable the scope and new defaults.
102+ # By Default, these flag are False.
103+ # For more detail: https://docs.openstack.org/oslo.policy/latest/configuration/index.html#oslo_policy.enforce_scope
104+ NOVA_ENFORCE_SCOPE=$( trueorfalse False NOVA_ENFORCE_SCOPE)
105+
100106if [[ $SERVICE_IP_VERSION == 6 ]]; then
101107 NOVA_MY_IP=" $HOST_IPV6 "
102108else
@@ -481,6 +487,10 @@ function create_nova_conf {
481487 NOVA_ENABLED_APIS=$( echo $NOVA_ENABLED_APIS | sed " s/,metadata//" )
482488 fi
483489 iniset $NOVA_CONF DEFAULT enabled_apis " $NOVA_ENABLED_APIS "
490+ if [[ " $NOVA_ENFORCE_SCOPE " == " True" || " $ENFORCE_SCOPE " == " True" ]]; then
491+ iniset $NOVA_CONF oslo_policy enforce_new_defaults True
492+ iniset $NOVA_CONF oslo_policy enforce_scope True
493+ fi
484494 if is_service_enabled tls-proxy && [ " $NOVA_USE_MOD_WSGI " == " False" ]; then
485495 # Set the service port for a proxy to take the original
486496 iniset $NOVA_CONF DEFAULT osapi_compute_listen_port " $NOVA_SERVICE_PORT_INT "
Original file line number Diff line number Diff line change @@ -674,6 +674,10 @@ function configure_tempest {
674674 iniset $TEMPEST_CONFIG auth admin_project_name ' '
675675 fi
676676
677+ if [[ " $NOVA_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
678+ iniset $TEMPEST_CONFIG enforce_scope nova true
679+ fi
680+
677681 if [[ " $GLANCE_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
678682 iniset $TEMPEST_CONFIG enforce_scope glance true
679683 fi
You can’t perform that action at this time.
0 commit comments