Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set_policy: convert known parameters to integers
When using set_policy to define the 'expires' policy, or setting 'ha-params' when using 'ha-mode' 'exactly', the rabbitmqctl provider passes a stringified numeric value to the `rabbitmqctl set_policy' invocation. In turn, this one chokes on the values and throws the following error: err: ... set_policy -p vhost --priority 0 --apply-to queues expire_queues ^rpc_.* {"expires":"1800000"}' returned 2: Setting policy "expire_queues" for pattern "^rtcp_.*" to "{\"expires\":\"1800000\"}" with priority "0" ... <<"1800000">> is not a valid queue expiry This is with puppet 2.7. I'm not 100% sure why this happens - it seems the a hash is passed all-strings down to the type/provider in 2.7? Even if in the manifest file, a numeric value is used. Hum? 82 rabbitmq_policy { 'expire_queues@vhost': 83 pattern => '^rpc_.*', 84 applyto => 'queues', 85 definition => { 86 'expires' => 1800000, 87 } 88 } As a work-around, this commit adds two special cases to explicity convert the 'ha-params' field in case of ha-mode 'exactly' as well as converting the 'expires' setting when provided.
- Loading branch information