OpenStack Dashboard (Horizon)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.py 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  2. # not use this file except in compliance with the License. You may obtain
  3. # a copy of the License at
  4. #
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. #
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  9. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  10. # License for the specific language governing permissions and limitations
  11. # under the License.
  12. import os
  13. from oslo_config import cfg
  14. DashboardGroup = [
  15. cfg.StrOpt('dashboard_url',
  16. default='http://localhost/',
  17. help="Where the dashboard can be found"),
  18. cfg.StrOpt('help_url',
  19. default='http://docs.openstack.org/',
  20. help="Dashboard help page url"),
  21. ]
  22. IdentityGroup = [
  23. cfg.StrOpt('username',
  24. default='demo',
  25. help="Username to use for non-admin API requests."),
  26. cfg.StrOpt('password',
  27. default='secretadmin',
  28. help="API key to use when authenticating.",
  29. secret=True),
  30. cfg.StrOpt('home_project',
  31. default='demo',
  32. help="Project to keep all objects belonging to a regular user."
  33. ),
  34. cfg.StrOpt('admin_username',
  35. default='admin',
  36. help="Administrative Username to use for admin API "
  37. "requests."),
  38. cfg.StrOpt('admin_password',
  39. default='secretadmin',
  40. help="API key to use when authenticating as admin.",
  41. secret=True),
  42. cfg.StrOpt('admin_home_project',
  43. default='admin',
  44. help="Project to keep all objects belonging to an admin user."),
  45. cfg.StrOpt('default_keystone_role',
  46. default='Member',
  47. help="Name of default role every user gets in his new project"),
  48. cfg.StrOpt('default_keystone_admin_role',
  49. default='admin',
  50. help="Name of the role that grants admin rights to a user in "
  51. "his project"),
  52. ]
  53. ImageGroup = [
  54. cfg.StrOpt('panel_type',
  55. default='legacy',
  56. help='type/version of images panel'),
  57. cfg.StrOpt('http_image',
  58. default='http://download.cirros-cloud.net/0.3.1/'
  59. 'cirros-0.3.1-x86_64-uec.tar.gz',
  60. help='http accessible image'),
  61. cfg.ListOpt('images_list',
  62. default=['cirros-0.3.4-x86_64-uec',
  63. 'cirros-0.3.4-x86_64-uec-kernel',
  64. 'cirros-0.3.4-x86_64-uec-ramdisk'],
  65. help='default list of images')
  66. ]
  67. NetworkGroup = [
  68. cfg.StrOpt('network_cidr',
  69. default='10.100.0.0/16',
  70. help='The cidr block to allocate tenant ipv4 subnets from'),
  71. ]
  72. AvailableServiceGroup = [
  73. cfg.BoolOpt('neutron',
  74. default=True),
  75. ]
  76. SeleniumGroup = [
  77. cfg.IntOpt('implicit_wait',
  78. default=10,
  79. help="Implicit wait timeout in seconds"),
  80. cfg.IntOpt('explicit_wait',
  81. default=300,
  82. help="Explicit wait timeout in seconds"),
  83. cfg.IntOpt('page_timeout',
  84. default=30,
  85. help="Page load timeout in seconds"),
  86. cfg.StrOpt('screenshots_directory',
  87. default="integration_tests_screenshots",
  88. help="Output screenshot directory"),
  89. cfg.BoolOpt('maximize_browser',
  90. default=True,
  91. help="Is the browser size maximized for each test?"),
  92. ]
  93. FlavorsGroup = [
  94. cfg.StrOpt('panel_type',
  95. default='legacy',
  96. help='type/version of flavors panel'),
  97. ]
  98. ScenarioGroup = [
  99. cfg.StrOpt('ssh_user',
  100. default='cirros',
  101. help='ssh username for image file'),
  102. ]
  103. InstancesGroup = [
  104. cfg.StrOpt('available_zone',
  105. default='nova',
  106. help="Zone to be selected for launch Instances"),
  107. cfg.StrOpt('image_name',
  108. default='cirros-0.3.4-x86_64-uec (24.0 MB)',
  109. help="Boot Source to be selected for launch Instances"),
  110. cfg.StrOpt('flavor',
  111. default='m1.tiny',
  112. help="Flavor to be selected for launch Instances"),
  113. ]
  114. VolumeGroup = [
  115. cfg.StrOpt('volume_type',
  116. default='lvmdriver-1',
  117. help='Default volume type'),
  118. cfg.StrOpt('volume_size',
  119. default='1',
  120. help='Default volume size ')
  121. ]
  122. PluginGroup = [
  123. cfg.BoolOpt('is_plugin',
  124. default='False',
  125. help="Set to true if this is a plugin"),
  126. cfg.MultiStrOpt('plugin_page_path',
  127. default='',
  128. help='Additional path to look for plugin page content'),
  129. cfg.MultiStrOpt('plugin_page_structure',
  130. default='')
  131. ]
  132. def _get_config_files():
  133. conf_dir = os.path.join(
  134. os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
  135. 'integration_tests')
  136. conf_file = os.environ.get('HORIZON_INTEGRATION_TESTS_CONFIG_FILE',
  137. "%s/horizon.conf" % conf_dir)
  138. config_files = [conf_file]
  139. local_config = os.environ.get('HORIZON_INTEGRATION_TESTS_LOCAL_CONFIG',
  140. "%s/local-horizon.conf" % conf_dir)
  141. if os.path.isfile(local_config):
  142. config_files.append(local_config)
  143. return config_files
  144. def get_config():
  145. cfg.CONF([], project='horizon', default_config_files=_get_config_files())
  146. cfg.CONF.register_opts(DashboardGroup, group="dashboard")
  147. cfg.CONF.register_opts(IdentityGroup, group="identity")
  148. cfg.CONF.register_opts(NetworkGroup, group="network")
  149. cfg.CONF.register_opts(AvailableServiceGroup, group="service_available")
  150. cfg.CONF.register_opts(SeleniumGroup, group="selenium")
  151. cfg.CONF.register_opts(FlavorsGroup, group="flavors")
  152. cfg.CONF.register_opts(ImageGroup, group="image")
  153. cfg.CONF.register_opts(ScenarioGroup, group="scenario")
  154. cfg.CONF.register_opts(InstancesGroup, group="launch_instances")
  155. cfg.CONF.register_opts(PluginGroup, group="plugin")
  156. cfg.CONF.register_opts(VolumeGroup, group="volume")
  157. return cfg.CONF