Browse Source

Fix Cinder local endpoint check

Since Mitaka, Cinder returns 300 instead of 200 in previous releases

Change-Id: Ia1e35da330754d5dc21573d3b469cb708ca28d28
Swann Croiset 2 years ago
parent
commit
973c62b04b
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      deployment_scripts/puppet/manifests/collectd.pp

+ 8
- 2
deployment_scripts/puppet/manifests/collectd.pp View File

@@ -17,6 +17,7 @@ notice('fuel-plugin-lma-collector: collectd.pp')
17 17
 if hiera('lma::collector::influxdb::server', false) {
18 18
   prepare_network_config(hiera_hash('network_scheme', {}))
19 19
 
20
+  $fuel_version = 0 + hiera('fuel_version')
20 21
   $management_vip  = hiera('management_vip')
21 22
   $mgmt_address    = get_network_role_property('management', 'ipaddr')
22 23
   $lma_collector   = hiera_hash('lma_collector')
@@ -119,7 +120,6 @@ if hiera('lma::collector::influxdb::server', false) {
119 120
   }
120 121
   # Deal with detach-* plugins
121 122
   if $is_mysql_server {
122
-    $fuel_version = 0 + hiera('fuel_version')
123 123
     if $fuel_version < 9.0 {
124 124
       $mysql_resource_name = 'p_mysql'
125 125
     } else {
@@ -251,6 +251,12 @@ if hiera('lma::collector::influxdb::server', false) {
251 251
     $neutron_api    = get_network_role_property('neutron/api', 'ipaddr')
252 252
     $nova_api       = get_network_role_property('nova/api', 'ipaddr')
253 253
     $swift_api      = get_network_role_property('swift/api', 'ipaddr')
254
+    if $fuel_version < 9.0 {
255
+      $cinder_expected_code = 200
256
+    } else {
257
+      # Since Mitaka, Cinder returns 300 instead of 200 in previous releases
258
+      $cinder_expected_code = 300
259
+    }
254 260
     class { 'lma_collector::collectd::check_local_endpoint':
255 261
       urls           => {
256 262
         'cinder-api'          => "http://${cinder_api}:8776",
@@ -263,7 +269,7 @@ if hiera('lma::collector::influxdb::server', false) {
263 269
         'swift-api'           => "http://${swift_api}:8080/info",
264 270
       },
265 271
       expected_codes => {
266
-        'cinder-api'          => 300,
272
+        'cinder-api'          => $cinder_expected_code,
267 273
         'glance-api'          => 300,
268 274
         'heat-api'            => 300,
269 275
         'heat-cfn-api'        => 300,

Loading…
Cancel
Save