From 95e749ddd20832488e679d17dcd208afc69d7123 Mon Sep 17 00:00:00 2001 From: William Yardley Date: Fri, 6 Sep 2024 10:11:29 -0700 Subject: [PATCH] Convert `queue-version` to integer Fixes #1017 --- lib/puppet/type/rabbitmq_policy.rb | 1 + spec/unit/puppet/type/rabbitmq_policy_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/puppet/type/rabbitmq_policy.rb b/lib/puppet/type/rabbitmq_policy.rb index 0bf11ad49..33f35f0b2 100644 --- a/lib/puppet/type/rabbitmq_policy.rb +++ b/lib/puppet/type/rabbitmq_policy.rb @@ -11,6 +11,7 @@ max-length max-length-bytes message-ttl + queue-version shards-per-node ].freeze diff --git a/spec/unit/puppet/type/rabbitmq_policy_spec.rb b/spec/unit/puppet/type/rabbitmq_policy_spec.rb index 109170d01..46742aef0 100644 --- a/spec/unit/puppet/type/rabbitmq_policy_spec.rb +++ b/spec/unit/puppet/type/rabbitmq_policy_spec.rb @@ -221,6 +221,19 @@ end.to raise_error(Puppet::Error, %r{Invalid initial-cluster-size value 'impressive}) end + it 'accepts and converts the queue-version value' do + definition = { 'queue-version' => '2' } + policy[:definition] = definition + expect(policy[:definition]['queue-version']).to eq(2) + end + + it 'does not accept non-numeric queue-version value' do + definition = { 'queue-version' => 'oogabooga' } + expect do + policy[:definition] = definition + end.to raise_error(Puppet::Error, %r{Invalid queue-version value.*oogabooga}) + end + context 'accepts list value in ha-params when ha-mode = nodes' do before do policy[:definition] = definition