]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Use $::os_service_default instead of undef as default value
authorTakashi Kajinami <tkajinam@redhat.com>
Sun, 20 Dec 2020 14:19:10 +0000 (23:19 +0900)
committerTakashi Kajinami <tkajinam@redhat.com>
Mon, 21 Dec 2020 03:26:13 +0000 (12:26 +0900)
... so that we can ensure the parameter is managed and unset by
default.

Change-Id: If3cf0e385befc686fe3ed1b5be6bb63652c9b0f4

manifests/agent/polling.pp
releasenotes/notes/coordination_url-use-os_service_default-b51796ec9bc99129.yaml [new file with mode: 0644]
spec/classes/ceilometer_agent_polling_spec.rb

index 804fec9c3dfe2d15af27e1cefadfd7a128b1c882..667f6afd662ed0c446f0a5f35578620a6d48b58f 100644 (file)
@@ -30,7 +30,7 @@
 #
 # [*coordination_url*]
 #   (Optional) The url to use for distributed group membership coordination.
-#   Defaults to undef.
+#   Defaults to $::os_service_default.
 #
 # [*instance_discovery_method*]
 #   (Optional) method to discovery instances running on compute node
@@ -65,7 +65,7 @@ class ceilometer::agent::polling (
   $central_namespace         = true,
   $compute_namespace         = true,
   $ipmi_namespace            = true,
-  $coordination_url          = undef,
+  $coordination_url          = $::os_service_default,
   $instance_discovery_method = $::os_service_default,
   $manage_polling            = false,
   $polling_interval          = 600,
@@ -144,10 +144,15 @@ class ceilometer::agent::polling (
     tag        => 'ceilometer-service',
   }
 
-  if $coordination_url {
-    ceilometer_config {
-      'coordination/backend_url': value => $coordination_url
-    }
+  if $coordination_url == undef {
+    warning('Usage of undef for the coordination_url parameter has been deprecated. \
+Use $::os_service_default instead')
+    $coordination_url_real = $::os_service_default
+  } else {
+    $coordination_url_real = $coordination_url
+  }
+  ceilometer_config {
+    'coordination/backend_url': value => $coordination_url_real
   }
 
   if $manage_polling {
diff --git a/releasenotes/notes/coordination_url-use-os_service_default-b51796ec9bc99129.yaml b/releasenotes/notes/coordination_url-use-os_service_default-b51796ec9bc99129.yaml
new file mode 100644 (file)
index 0000000..0f2c2fa
--- /dev/null
@@ -0,0 +1,13 @@
+---
+upgrade:
+  - |
+    The default value for the ``ceilometer::agent::polling::coordination_url``
+    parameter has been changed from undef to $::os_service_default. Because
+    of this change now the ``ceilometer::agent::polling`` class ensures that
+    the ``coordination/backend_url`` parameter is unset by default.
+
+deprecations:
+  - |
+    Usage of ``undef`` for the ``ceilometer::agent::polling::coordination_url``
+    parameter has been deprecated and will be removed in a future release.
+    Use ``$::os_service_default`` or any specific value instead.
index e2e2a827187a1513e29913a497416b874ba33fcc..e5867ff31724c0f8128deeee425765a4b3576985 100644 (file)
@@ -48,7 +48,7 @@ describe 'ceilometer::agent::polling' do
         :tag        => 'ceilometer-service',
       )}
 
-      it { should_not contain_ceilometer_config('coordination/backend_url') }
+      it { should contain_ceilometer_config('coordination/backend_url').with_value('<SERVICE DEFAULT>') }
       it { should_not contain_file('polling') }
     end