Author: Thomas Goirand <zigo@debian.org>
Date: Tue, 01 Jul 2025 10:37:09 +0200
Description: Expose rabbit_qos_prefetch_count
 The option was supported by puppet-oslo but was not configurable via
 this module.
Change-Id: I113bbcf632bbd8dd645b0dc2dda48fda21f9d4e8
Forwarded: https://review.opendev.org/c/openstack/puppet-cloudkitty/+/953857
Last-Update: 2025-07-01

Index: puppet-module-cloudkitty/manifests/init.pp
===================================================================
--- puppet-module-cloudkitty.orig/manifests/init.pp
+++ puppet-module-cloudkitty/manifests/init.pp
@@ -37,6 +37,10 @@
 #   will be run through a green thread.
 #   Defaults to $facts['os_service_default']
 #
+# [*rabbit_qos_prefetch_count*]
+#   (Optional) Specifies the number of messages to prefetch.
+#   Defaults to $facts['os_service_default']
+#
 # [*rabbit_quorum_queue*]
 #   (Optional) Use quorum queues in RabbitMQ.
 #   Defaults to $facts['os_service_default']
@@ -223,6 +227,7 @@ class cloudkitty(
   $rabbit_heartbeat_rate              = $facts['os_service_default'],
   $rabbit_heartbeat_in_pthread        = $facts['os_service_default'],
   $rabbit_ha_queues                   = $facts['os_service_default'],
+  $rabbit_qos_prefetch_count          = $facts['os_service_default'],
   $rabbit_quorum_queue                = $facts['os_service_default'],
   $rabbit_transient_queues_ttl        = $facts['os_service_default'],
   $rabbit_transient_quorum_queue      = $facts['os_service_default'],
@@ -286,6 +291,7 @@ class cloudkitty(
     heartbeat_timeout_threshold     => $rabbit_heartbeat_timeout_threshold,
     heartbeat_rate                  => $rabbit_heartbeat_rate,
     heartbeat_in_pthread            => $rabbit_heartbeat_in_pthread,
+    rabbit_qos_prefetch_count       => $rabbit_qos_prefetch_count,
     kombu_ssl_version               => $kombu_ssl_version,
     kombu_ssl_keyfile               => $kombu_ssl_keyfile,
     kombu_ssl_certfile              => $kombu_ssl_certfile,
Index: puppet-module-cloudkitty/releasenotes/notes/rabbit_qos_prefetch_count-55d76ced5e1d735f.yaml
===================================================================
--- /dev/null
+++ puppet-module-cloudkitty/releasenotes/notes/rabbit_qos_prefetch_count-55d76ced5e1d735f.yaml
@@ -0,0 +1,4 @@
+---
+features:
+  - |
+    The new ``cloudkitty::rabbit_qos_prefetch_count`` parameter has been added.
Index: puppet-module-cloudkitty/spec/classes/cloudkitty_init_spec.rb
===================================================================
--- puppet-module-cloudkitty.orig/spec/classes/cloudkitty_init_spec.rb
+++ puppet-module-cloudkitty/spec/classes/cloudkitty_init_spec.rb
@@ -44,6 +44,7 @@ describe 'cloudkitty' do
           :rabbit_ha_queues                => '<SERVICE DEFAULT>',
           :rabbit_retry_interval           => '<SERVICE DEFAULT>',
           :rabbit_quorum_queue             => '<SERVICE DEFAULT>',
+          :rabbit_qos_prefetch_count       => '<SERVICE DEFAULT>',
           :rabbit_transient_quorum_queue   => '<SERVICE DEFAULT>',
           :rabbit_transient_queues_ttl     => '<SERVICE DEFAULT>',
           :rabbit_quorum_delivery_limit    => '<SERVICE DEFAULT>',
@@ -82,6 +83,7 @@ describe 'cloudkitty' do
           :rabbit_heartbeat_rate              => 10,
           :rabbit_heartbeat_in_pthread        => true,
           :rabbit_quorum_queue                => true,
+          :rabbit_qos_prefetch_count          => 10,
           :rabbit_transient_quorum_queue      => false,
           :rabbit_transient_queues_ttl        => 60,
           :rabbit_quorum_delivery_limit       => 3,
@@ -123,6 +125,7 @@ describe 'cloudkitty' do
           :kombu_compression               => 'gzip',
           :rabbit_ha_queues                => true,
           :rabbit_quorum_queue             => true,
+          :rabbit_qos_prefetch_count       => 10,
           :rabbit_transient_quorum_queue   => false,
           :rabbit_transient_queues_ttl     => 60,
           :rabbit_quorum_delivery_limit    => 3,
