Skip to content

Commit

Permalink
Convert queue-version to integer
Browse files Browse the repository at this point in the history
Fixes #1017
  • Loading branch information
wyardley committed Sep 6, 2024
1 parent 47be9d0 commit 95e749d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/puppet/type/rabbitmq_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
max-length
max-length-bytes
message-ttl
queue-version
shards-per-node
].freeze

Expand Down
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 @@ -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
Expand Down

0 comments on commit 95e749d

Please sign in to comment.