Make user role logging optional

Not in every cloud does tempest have permissions to list the
role assignments. Since it is not critial for running the tests,
the logging of the user roles should be configurable.

Change-Id: I8aea2b597b9dd9bbdc5a1527fae03e86364aab4c
This commit is contained in:
Bas de Bruijne 2022-12-15 11:12:45 -04:00
parent 577953114e
commit 530a88a434
2 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,9 @@ OctaviaGroup = [
cfg.StrOpt('octavia_svc_username', default='admin',
help='The service_auth username the Octavia services are using'
'to access other OpenStack services.'),
cfg.BoolOpt('log_user_roles',
default=True,
help='Log the user roles at the start of every test.'),
# load-balancer specific options
cfg.FloatOpt('check_interval',
default=5,

View File

@ -136,6 +136,9 @@ class LoadBalancerBaseTest(validators.ValidatorsMixin,
cls.set_network_resources()
super(LoadBalancerBaseTest, cls).setup_credentials()
if not CONF.load_balancer.log_user_roles:
return
# Log the user roles for this test run
role_name_cache = {}
for cred in cls.credentials: