Skip to content

Commit

Permalink
Fix future parser errors
Browse files Browse the repository at this point in the history
Type checking fixes:

Ports should be allowed to be integers, so wrap each validate_re
function call for port-like parameters in `if ! is_integer`.

Scope fixes:

Some parameters were not in scope in the config class, so they were not
available to the rabbitmq.config template. This change adds those
parameters to the config class.
  • Loading branch information
Colleen Murphy committed Mar 24, 2015
1 parent f47dc9e commit 5ba917b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
5 changes: 5 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
$env_config = $rabbitmq::env_config
$env_config_path = $rabbitmq::env_config_path
$erlang_cookie = $rabbitmq::erlang_cookie
$interface = $rabbitmq::interface
$management_port = $rabbitmq::management_port
$node_ip_address = $rabbitmq::node_ip_address
$plugin_dir = $rabbitmq::plugin_dir
Expand All @@ -30,6 +31,7 @@
$ssl_cert = $rabbitmq::ssl_cert
$ssl_key = $rabbitmq::ssl_key
$ssl_port = $rabbitmq::ssl_port
$ssl_interface = $rabbitmq::ssl_interface
$ssl_management_port = $rabbitmq::ssl_management_port
$ssl_stomp_port = $rabbitmq::ssl_stomp_port
$ssl_verify = $rabbitmq::ssl_verify
Expand All @@ -39,13 +41,16 @@
$ldap_auth = $rabbitmq::ldap_auth
$ldap_server = $rabbitmq::ldap_server
$ldap_user_dn_pattern = $rabbitmq::ldap_user_dn_pattern
$ldap_other_bind = $rabbitmq::ldap_other_bind
$ldap_use_ssl = $rabbitmq::ldap_use_ssl
$ldap_port = $rabbitmq::ldap_port
$ldap_log = $rabbitmq::ldap_log
$ldap_config_variables = $rabbitmq::ldap_config_variables
$wipe_db_on_cookie_change = $rabbitmq::wipe_db_on_cookie_change
$config_variables = $rabbitmq::config_variables
$config_kernel_variables = $rabbitmq::config_kernel_variables
$cluster_partition_handling = $rabbitmq::cluster_partition_handling
$file_limit = $rabbitmq::file_limit
$default_env_variables = {
'NODE_PORT' => $port,
'NODE_IP_ADDRESS' => $node_ip_address
Expand Down
25 changes: 18 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,17 @@
validate_string($env_config)
validate_absolute_path($env_config_path)
validate_string($erlang_cookie)
validate_re($management_port, '\d+')
if ! is_integer($management_port) {
validate_re($management_port, '\d+')
}
validate_string($node_ip_address)
validate_absolute_path($plugin_dir)
validate_re($port, ['\d+','UNSET'])
validate_re($stomp_port, '\d+')
if ! is_integer($port) {
validate_re($port, ['\d+','UNSET'])
}
if ! is_integer($stomp_port) {
validate_re($stomp_port, '\d+')
}
validate_bool($wipe_db_on_cookie_change)
validate_bool($tcp_keepalive)
if ! is_integer($file_limit) {
Expand All @@ -106,10 +112,15 @@
validate_string($ssl_cacert)
validate_string($ssl_cert)
validate_string($ssl_key)
validate_re($ssl_port, '\d+')
validate_re($ssl_management_port, '\d+')
validate_string($ssl_stomp_port)
validate_re($ssl_stomp_port, '\d+')
if ! is_integer($ssl_port) {
validate_re($ssl_port, '\d+')
}
if ! is_integer($ssl_management_port) {
validate_re($ssl_management_port, '\d+')
}
if ! is_integer($ssl_stomp_port) {
validate_re($ssl_stomp_port, '\d+')
}
validate_bool($stomp_ensure)
validate_bool($ldap_auth)
validate_string($ldap_server)
Expand Down

0 comments on commit 5ba917b

Please sign in to comment.