Codebase list cinder-tempest-plugin / 89823d9
Avoid duplicate 'barbican' service_available option The cinder and barbican tempest plugins both need the 'barbican' service_available option to be defined, but they both can't register the option. This patch ensures the cinder plugin registers the option only when the barbican plugin isn't present. Closes-Bug: #1991068 Change-Id: I51a22afae4fc98e2c2b8c1e82e8211a27649022c Alan Bishop 3 years ago
2 changed file(s) with 17 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
2525
2626 # The barbican service is discovered by config_tempest [1], and will appear
2727 # in the [service_available] group in tempest.conf. However, the 'barbican'
28 # option isn't registered by tempest itself, and so we do it here. This adds
29 # the ability to test CONF.service_available.barbican.
28 # option isn't registered by tempest itself, and so we may need to do it.
29 # This adds the ability to test CONF.service_available.barbican.
3030 #
3131 # [1] I96800a95f844ce7675d266e456e01620e63e347a
32 service_available_option = [
32 barbican_service_option = [
3333 cfg.BoolOpt('barbican',
3434 default=False,
3535 help="Whether or not barbican is expected to be available"),
1313 # under the License.
1414
1515 import os
16 import sys
1617
1718 from tempest import config
1819 from tempest.test_discover import plugins
4546 config.register_opt_group(conf, config.volume_feature_group,
4647 project_config.cinder_option)
4748
48 config.register_opt_group(conf, config.service_available_group,
49 project_config.service_available_option)
49 # Define the 'barbican' service_available option, but only if the
50 # barbican_tempest_plugin isn't present. It also defines the option,
51 # and we need to avoid a duplicate option registration.
52 if 'barbican_tempest_plugin' not in sys.modules:
53 config.register_opt_group(conf, config.service_available_group,
54 project_config.barbican_service_option)
5055
5156 def get_opt_lists(self):
5257 """Get a list of options for sample config generation.
5459 :return: A list of tuples with the group name and options in that
5560 group.
5661 """
57 return [
62 opt_lists = [
5863 (config.volume_feature_group.name, project_config.cinder_option),
59 (config.service_available_group.name,
60 project_config.service_available_option),
6164 ]
65
66 if 'barbican_tempest_plugin' not in sys.modules:
67 opt_lists.append((config.service_available_group.name,
68 project_config.barbican_service_option))
69
70 return opt_lists