Update default api configurations

OpenStack Health api has a new functionality that allows users to
retrieve the grouping keys used on the dashboard page.

A few of them simply don't make sense for the users, since they
are too granular.

This commit includes a new default configuration that will ignore
these keys. In case you are interested on how I come up with these keys,
please check this patch: https://review.openstack.org/#/c/240453/

Change-Id: Ibe591d9af94c1cd8d5c1d4956c1c82b4a764b5b7
This commit is contained in:
Glauco Oliveira 2015-11-19 11:12:15 -02:00
parent 10bb4095f0
commit 346894e2ef
3 changed files with 28 additions and 0 deletions

View File

@ -14,10 +14,28 @@ class openstack_health::api(
$server_admin = "webmaster@${::fqdn}",
$vhost_name = 'localhost',
$vhost_port = 5000,
$ignored_run_metadata_keys = undef,
) {
include ::httpd::mod::wsgi
$default_ignored_run_metadata_keys = ['build_change', 'build_node',
'build_patchset', 'build_ref',
'build_short_uuid', 'build_uuid',
'build_zuul_url', 'filename']
if $ignored_run_metadata_keys {
# In case it was defined, ensure the value provided is an array
if is_array($ignored_run_metadata_keys) {
$ignored_keys = $ignored_run_metadata_keys
} else {
fail('$ignored_run_metadata_keys parameter should be an array of strings')
}
} else {
# In case it was not defined, use the default value
$ignored_keys = $default_ignored_run_metadata_keys
}
$api_dir = "${source_dir}/openstack_health"
$virtualenv_dir = "${source_dir}/.venv"

View File

@ -43,6 +43,10 @@ describe 'puppet-openstack_health::api manifest', :if => ['debian', 'ubuntu'].in
it { should be_file }
it { should be_owned_by 'openstack_health' }
it { should be_grouped_into 'openstack_health' }
its(:content) { should contain 'db_uri' }
its(:content) { should contain 'ignored_run_metadata_keys' }
its(:content) { should contain 'build_change' }
its(:content) { should contain 'build_zuul_url' }
end
end

View File

@ -1,2 +1,8 @@
[default]
db_uri = <%= scope.lookupvar("openstack_health::api::db_uri") %>
<% if @ignored_keys.length > 0 -%>
ignored_run_metadata_keys =
<% @ignored_keys.each do |ignored_key| -%>
<%= ignored_key %>
<% end -%>
<% end -%>