summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwann Croiset <scroiset@mirantis.com>2017-01-25 14:36:54 +0100
committerSwann Croiset <scroiset@mirantis.com>2017-01-25 14:46:28 +0100
commitb19fd832daf07a8c0a77be689a9b386af0c6fd5b (patch)
tree18731065bc8036146ba912f2e9371230bec73c18
parent389648c5153e06de2506396189ac35c586a86743 (diff)
Correctly cleanup self-monitoring sandboxes
Notes
Notes (review): Code-Review+2: Swann Croiset <scroiset@mirantis.com> Workflow+1: Swann Croiset <scroiset@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 27 Jan 2017 14:55:23 +0000 Reviewed-on: https://review.openstack.org/425176 Project: openstack/fuel-plugin-lma-collector Branch: refs/heads/master
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp35
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb8
2 files changed, 23 insertions, 20 deletions
diff --git a/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp b/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp
index 4acf74f..80849c2 100644
--- a/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp
+++ b/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp
@@ -118,24 +118,23 @@ define lma_collector::heka (
118 $heka_monitoring_ensure = absent 118 $heka_monitoring_ensure = absent
119 } 119 }
120 120
121 if $heka_monitoring { 121 heka::filter::sandbox { "heka_monitoring_${title}":
122 heka::filter::sandbox { "heka_monitoring_${title}": 122 ensure => $heka_monitoring_ensure,
123 ensure => $heka_monitoring_ensure, 123 config_dir => $config_dir,
124 config_dir => $config_dir, 124 filename => "${lma_collector::params::plugins_dir}/filters/heka_monitoring.lua",
125 filename => "${lma_collector::params::plugins_dir}/filters/heka_monitoring.lua", 125 message_matcher => "Type == 'heka.all-report'",
126 message_matcher => "Type == 'heka.all-report'", 126 require => ::Heka[$title],
127 require => ::Heka[$title], 127 module_directory => $lua_modules_dir,
128 module_directory => $lua_modules_dir, 128 notify => Class[$service_class],
129 notify => Class[$service_class], 129 }
130 }
131 130
132 # Dashboard is required to enable monitoring messages 131 # Dashboard is required to enable monitoring messages
133 heka::output::dashboard { "dashboard_${title}": 132 heka::output::dashboard { "dashboard_${title}":
134 config_dir => $config_dir, 133 ensure => $heka_monitoring_ensure,
135 dashboard_address => $lma_collector::params::dashboard_address, 134 config_dir => $config_dir,
136 dashboard_port => $dashboard_port, 135 dashboard_address => $lma_collector::params::dashboard_address,
137 require => ::Heka[$title], 136 dashboard_port => $dashboard_port,
138 notify => Class[$service_class], 137 require => ::Heka[$title],
139 } 138 notify => Class[$service_class],
140 } 139 }
141} 140}
diff --git a/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb b/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb
index 1972043..2bd5df5 100644
--- a/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb
+++ b/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb
@@ -67,8 +67,12 @@ describe 'lma_collector::heka' do
67 ) 67 )
68 should contain_heka__input__tcp('metric') 68 should contain_heka__input__tcp('metric')
69 should contain_heka__decoder__sandbox('metric' ) 69 should contain_heka__decoder__sandbox('metric' )
70 is_expected.to_not contain_heka__filter__sandbox('heka_monitoring_metric_collector') 70 should contain_heka__filter__sandbox('heka_monitoring_metric_collector').with(
71 is_expected.to_not contain_heka__output__dashboard('dashboard_metric_collector' ) 71 'ensure' => 'absent'
72 )
73 should contain_heka__output__dashboard('dashboard_metric_collector' ).with(
74 'ensure' => 'absent'
75 )
72 } 76 }
73 end 77 end
74end 78end