Skip to content

Commit 1ddae48

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add RBAC scope and new defaults setting support for placement"
2 parents aae4d3e + 16c2b38 commit 1ddae48

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎lib/placement‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ fi
4848
PLACEMENT_SERVICE_PROTOCOL=${PLACEMENT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
4949
PLACEMENT_SERVICE_HOST=${PLACEMENT_SERVICE_HOST:-$SERVICE_HOST}
5050

51+
# Flag to set the oslo_policy.enforce_scope and oslo_policy.enforce_new_defaults.
52+
# This is used to switch the Placement API policies scope and new defaults.
53+
# By Default, these flag are False.
54+
# For more detail: https://docs.openstack.org/oslo.policy/latest/configuration/index.html#oslo_policy.enforce_scope
55+
PLACEMENT_ENFORCE_SCOPE=$(trueorfalse False PLACEMENT_ENFORCE_SCOPE)
56+
5157
# Functions
5258
# ---------
5359

@@ -111,6 +117,10 @@ function configure_placement {
111117
else
112118
_config_placement_apache_wsgi
113119
fi
120+
if [[ "$PLACEMENT_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
121+
iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults True
122+
iniset $PLACEMENT_CONF oslo_policy enforce_scope True
123+
fi
114124
}
115125

116126
# create_placement_accounts() - Set up required placement accounts

‎lib/tempest‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,10 @@ function configure_tempest {
678678
iniset $TEMPEST_CONFIG enforce_scope nova true
679679
fi
680680

681+
if [[ "$PLACEMENT_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
682+
iniset $TEMPEST_CONFIG enforce_scope placement true
683+
fi
684+
681685
if [[ "$GLANCE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
682686
iniset $TEMPEST_CONFIG enforce_scope glance true
683687
fi

0 commit comments

Comments
 (0)