Skip to content

Commit 69d71cf

Browse files
author
Ghanshyam Mann
committed
Option to disable the scope & new defaults enforcement
In this release cycle, a few services are enabling the enforce scope and new defaults by default. Example Nova: - https://review.opendev.org/c/openstack/nova/+/866218) Until the new defaults enalbing by default is not released we should keep testing the old defaults in existing jobs and we can add new jobs testing new defautls. To do that we can provide the way in devstack to keep scope/new defaults disable by default which can be enabled by setting enforce_scope variable to true. Once any service release the new defaults enabled by default then we can switch the bhavior, enable the scope/new defaults by default and a single job can disbale them to keep testing the old defaults until service does not remove those. Change-Id: I5c2ec3e1667172a75e06458f16cf3d57947b2c53
1 parent a52041c commit 69d71cf

5 files changed

Lines changed: 19 additions & 1 deletion

File tree

lib/cinder

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ function configure_cinder {
411411
if [[ "$CINDER_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
412412
iniset $CINDER_CONF oslo_policy enforce_scope true
413413
iniset $CINDER_CONF oslo_policy enforce_new_defaults true
414+
else
415+
iniset $CINDER_CONF oslo_policy enforce_scope false
416+
iniset $CINDER_CONF oslo_policy enforce_new_defaults false
414417
fi
415418
}
416419

lib/glance

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ function configure_glance {
436436
iniset $GLANCE_API_CONF oslo_policy enforce_scope true
437437
iniset $GLANCE_API_CONF oslo_policy enforce_new_defaults true
438438
iniset $GLANCE_API_CONF DEFAULT enforce_secure_rbac true
439+
else
440+
iniset $GLANCE_API_CONF oslo_policy enforce_scope false
441+
iniset $GLANCE_API_CONF oslo_policy enforce_new_defaults false
442+
iniset $GLANCE_API_CONF DEFAULT enforce_secure_rbac false
439443
fi
440444
}
441445

lib/keystone

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,15 @@ function configure_keystone {
265265
iniset $KEYSTONE_CONF security_compliance lockout_duration $KEYSTONE_LOCKOUT_DURATION
266266
iniset $KEYSTONE_CONF security_compliance unique_last_password_count $KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT
267267
fi
268+
269+
iniset $KEYSTONE_CONF oslo_policy policy_file policy.yaml
270+
268271
if [[ "$KEYSTONE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
269272
iniset $KEYSTONE_CONF oslo_policy enforce_scope true
270273
iniset $KEYSTONE_CONF oslo_policy enforce_new_defaults true
271-
iniset $KEYSTONE_CONF oslo_policy policy_file policy.yaml
274+
else
275+
iniset $KEYSTONE_CONF oslo_policy enforce_scope false
276+
iniset $KEYSTONE_CONF oslo_policy enforce_new_defaults false
272277
fi
273278
}
274279

lib/nova

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@ function create_nova_conf {
490490
if [[ "$NOVA_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
491491
iniset $NOVA_CONF oslo_policy enforce_new_defaults True
492492
iniset $NOVA_CONF oslo_policy enforce_scope True
493+
else
494+
iniset $NOVA_CONF oslo_policy enforce_new_defaults False
495+
iniset $NOVA_CONF oslo_policy enforce_scope False
493496
fi
494497
if is_service_enabled tls-proxy && [ "$NOVA_USE_MOD_WSGI" == "False" ]; then
495498
# Set the service port for a proxy to take the original

lib/placement

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ function configure_placement {
120120
if [[ "$PLACEMENT_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
121121
iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults True
122122
iniset $PLACEMENT_CONF oslo_policy enforce_scope True
123+
else
124+
iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults False
125+
iniset $PLACEMENT_CONF oslo_policy enforce_scope False
123126
fi
124127
}
125128

0 commit comments

Comments
 (0)