Showing with 29 additions and 15 deletions.
  1. +1 −3 .fixtures.yml
  2. +8 −0 CHANGELOG.md
  3. +6 −1 lib/puppet/type/rabbitmq_policy.rb
  4. +1 −1 metadata.json
  5. +0 −10 spec/acceptance/nodesets/default.yml
  6. +13 −0 spec/unit/puppet/type/rabbitmq_policy_spec.rb
4 changes: 1 addition & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ fixtures:
archive: 'https://github.com/voxpupuli/puppet-archive'
erlang: 'https://github.com/garethr/garethr-erlang'
systemd: 'https://github.com/voxpupuli/puppet-systemd'
yumrepo_core:
repo: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core'
puppet_version: '>= 6.0.0'
yumrepo_core: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core'
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v13.1.1](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.1.1) (2023-11-01)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v13.1.0...v13.1.1)

**Fixed bugs:**

- Treat `initial-cluster-size` option in policy as an integer [\#950](https://github.com/voxpupuli/puppet-rabbitmq/pull/950) ([jimmybigcommerce](https://github.com/jimmybigcommerce))

## [v13.1.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.1.0) (2023-10-30)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v13.0.0...v13.1.0)
Expand Down
7 changes: 6 additions & 1 deletion lib/puppet/type/rabbitmq_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ def validate_definition(definition)
ha_sync_batch_size_val = definition['ha-sync-batch-size']
raise ArgumentError, "Invalid ha-sync-batch-size value '#{ha_sync_batch_size_val}'" unless ha_sync_batch_size_val.to_i.to_s == ha_sync_batch_size_val
end
if definition.key? 'delivery-limit' # rubocop:disable Style/GuardClause
if definition.key? 'delivery-limit'
delivery_limit_val = definition['delivery-limit']
raise ArgumentError, "Invalid delivery-limit value '#{delivery_limit_val}'" unless delivery_limit_val.to_i.to_s == delivery_limit_val
end
if definition.key? 'initial-cluster-size' # rubocop:disable Style/GuardClause
initial_cluster_size_val = definition['initial-cluster-size']
raise ArgumentError, "Invalid initial-cluster-size value '#{initial_cluster_size_val}'" unless initial_cluster_size_val.to_i.to_s == initial_cluster_size_val
end
end

def munge_definition(definition)
Expand All @@ -135,6 +139,7 @@ def munge_definition(definition)
definition['shards-per-node'] = definition['shards-per-node'].to_i if definition.key? 'shards-per-node'
definition['ha-sync-batch-size'] = definition['ha-sync-batch-size'].to_i if definition.key? 'ha-sync-batch-size'
definition['delivery-limit'] = definition['delivery-limit'].to_i if definition.key? 'delivery-limit'
definition['initial-cluster-size'] = definition['initial-cluster-size'].to_i if definition.key? 'initial-cluster-size'
definition
end
end
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-rabbitmq",
"version": "13.1.0",
"version": "13.1.1",
"author": "voxpupuli",
"summary": "Installs, configures, and manages RabbitMQ.",
"license": "Apache-2.0",
Expand Down
10 changes: 0 additions & 10 deletions spec/acceptance/nodesets/default.yml

This file was deleted.

13 changes: 13 additions & 0 deletions spec/unit/puppet/type/rabbitmq_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@
end.to raise_error(Puppet::Error, %r{Invalid delivery-limit value.*future})
end

it 'accepts and converts the initial-cluster-size value' do
definition = { 'initial-cluster-size' => '3' }
policy[:definition] = definition
expect(policy[:definition]['initial-cluster-size']).to eq(3)
end

it 'does not accept non-numeric initial-cluster-size value' do
definition = { 'initial-cluster-size' => 'impressive' }
expect do
policy[:definition] = definition
end.to raise_error(Puppet::Error, %r{Invalid initial-cluster-size value 'impressive})
end

context 'accepts list value in ha-params when ha-mode = nodes' do
before do
policy[:definition] = definition
Expand Down