Skip to content

Commit

Permalink
fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalBourdier committed Aug 29, 2017
1 parent bea8825 commit f09238e
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 21 deletions.
6 changes: 3 additions & 3 deletions examples/init.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Declare haproxy base class with configuration options
class { 'haproxy':
class { '::haproxy':
enable => true,
global_options => {
'log' => "${::ipaddress} local0",
Expand Down Expand Up @@ -36,7 +36,7 @@
server_name => $::hostname,
balancer_ip => $::ipaddress,
balancer_port => '8140',
balancermember_options => 'check'
balancermember_options => 'check',
}

# Declare a couple of Listening Services for haproxy.cfg
Expand All @@ -62,7 +62,7 @@
'mode' => 'http',
'stats' => [
'uri /',
'auth puppet:puppet'
'auth puppet:puppet',
],
},
}
2 changes: 1 addition & 1 deletion manifests/backend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
fail("An haproxy::listen resource was discovered with the same name (${section_name}) which is not supported")
}

include haproxy::params
include ::haproxy::params

if $instance == 'haproxy' {
$instance_name = 'haproxy'
Expand Down
2 changes: 1 addition & 1 deletion manifests/balancermember.pp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
$weight = undef,
) {

include haproxy::params
include ::haproxy::params

if $instance == 'haproxy' {
$instance_name = 'haproxy'
Expand Down
8 changes: 6 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Private class
#
define haproxy::config (
# lint:ignore:140chars
$instance_name,
$config_file,
$global_options,
Expand All @@ -9,6 +11,7 @@
$custom_fragment = undef, # A default is required for Puppet 2.7 compatibility. When 2.7 is no longer supported, this parameter default should be removed.
$merge_options = $haproxy::merge_options,
$config_validate_cmd = $haproxy::config_validate_cmd
# lint:endignore
) {

if $caller_module_name != $module_name {
Expand All @@ -21,7 +24,7 @@
} else {
$_global_options = $global_options
$_defaults_options = $defaults_options
warning("${module_name}: The \$merge_options parameter will default to true in the next major release. Please review the documentation regarding the implications.")
warning("${module_name}: The \$merge_options parameter will default to true in the next major release. Please review the documentation regarding the implications.") # lint:ignore:140chars
}

if $haproxy::params::manage_config_dir {
Expand Down Expand Up @@ -51,7 +54,8 @@
}

# validate_cmd introduced in Puppet 3.5
if ((!defined('$::puppetversion') or (versioncmp($::puppetversion, '3.5') >= 0)) and (!defined('$::serverversion') or versioncmp($::serverversion, '3.5') >= 0)) {
if ((!defined('$::puppetversion') or (versioncmp($::puppetversion, '3.5') >= 0)) and
(!defined('$::serverversion') or versioncmp($::serverversion, '3.5') >= 0)) {
Concat[$_config_file] {
validate_cmd => $config_validate_cmd,
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/defaults.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
) {

if $instance == 'haproxy' {
include haproxy
include ::haproxy
$instance_name = 'haproxy'
$config_file = $haproxy::config_file
} else {
include haproxy::params
include ::haproxy::params
$instance_name = "haproxy-${instance}"
$config_file = inline_template($haproxy::params::config_file_tmpl)
}
include haproxy::globals
include ::haproxy::globals
$_sort_options_alphabetic = pick($sort_options_alphabetic, $haproxy::globals::sort_options_alphabetic)

concat::fragment { "${instance_name}-${name}_defaults_block":
Expand Down
4 changes: 2 additions & 2 deletions manifests/frontend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
validate_hash($bind)
}

include haproxy::params
include ::haproxy::params

if $instance == 'haproxy' {
$instance_name = 'haproxy'
Expand All @@ -129,7 +129,7 @@

validate_absolute_path(dirname($_config_file))

include haproxy::globals
include ::haproxy::globals
$_sort_options_alphabetic = pick($sort_options_alphabetic, $haproxy::globals::sort_options_alphabetic)

if $defaults == undef {
Expand Down
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
# Contents for the `/etc/defaults/haproxy` file on Debian. Defaults to "ENABLED=1\n" on Debian, and is ignored on other systems.
#
# [*sysconfig_options*]
# Contents for the `/etc/sysconfig/haproxy` file on RedHat(-based) systems. Defaults to OPTIONS="" on RedHat(-based) systems and is ignored on others
# Contents for the `/etc/sysconfig/haproxy` file on RedHat(-based) systems.
# Defaults to OPTIONS="" on RedHat(-based) systems and is ignored on others
#
# [*global_options*]
# A hash of all the haproxy global options. If you want to specify more
Expand Down
2 changes: 2 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Private class
define haproxy::install (
# lint:ignore:140chars
$package_ensure,
$package_name = undef, # A default is required for Puppet 2.7 compatibility. When 2.7 is no longer supported, this parameter default should be removed.
# lint:endignore
) {
if $caller_module_name != $module_name {
fail("Use of private class ${name} by ${caller_module_name}")
Expand Down
2 changes: 1 addition & 1 deletion manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@

# Since this is a 'define', we can not use 'inherts haproxy::params'.
# Therefore, we "include haproxy::params" for any parameters we need.
include haproxy::params
include ::haproxy::params

$_global_options = pick($global_options, $haproxy::params::global_options)
$_defaults_options = pick($defaults_options, $haproxy::params::defaults_options)
Expand Down
6 changes: 3 additions & 3 deletions manifests/listen.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
'option' => [
'tcplog',
],
'balance' => 'roundrobin'
'balance' => 'roundrobin',
},
$instance = 'haproxy',
$section_name = $name,
Expand Down Expand Up @@ -128,7 +128,7 @@
fail("An haproxy::backend resource was discovered with the same name (${section_name}) which is not supported")
}

include haproxy::params
include ::haproxy::params

if $instance == 'haproxy' {
$instance_name = 'haproxy'
Expand All @@ -140,7 +140,7 @@

validate_absolute_path(dirname($_config_file))

include haproxy::globals
include ::haproxy::globals
$_sort_options_alphabetic = pick($sort_options_alphabetic, $haproxy::globals::sort_options_alphabetic)

if $defaults == undef {
Expand Down
2 changes: 1 addition & 1 deletion manifests/mapfile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
) {
$mapfile_name = $title

validate_re($ensure, '^present|absent$', "Haproxy::Mapfile[${mapfile_name}]: '${ensure}' is not supported for ensure. Allowed values are 'present' and 'absent'.")
validate_re($ensure, '^present|absent$', "Haproxy::Mapfile[${mapfile_name}]: '${ensure}' is not supported for ensure. Allowed values are 'present' and 'absent'.") # lint:ignore:140chars
validate_array($mappings)
validate_array($instances)

Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'user' => 'haproxy',
'group' => 'haproxy',
'daemon' => '',
'stats' => 'socket /var/lib/haproxy/stats'
'stats' => 'socket /var/lib/haproxy/stats',
}
$defaults_options = {
'log' => 'global',
Expand All @@ -38,7 +38,7 @@
'server 1m',
'check 10s',
],
'maxconn' => '8000'
'maxconn' => '8000',
}
# Single instance:
$config_dir = '/etc/haproxy'
Expand Down
2 changes: 2 additions & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Private class
define haproxy::service (
# lint:ignore:140chars
$instance_name,
$service_ensure,
$service_manage,
$restart_command = undef, # A default is required for Puppet 2.7 compatibility. When 2.7 is no longer supported, this parameter default should be removed.
$service_options = $haproxy::params::service_options,
$sysconfig_options = $haproxy::params::sysconfig_options,
# lint:endignore
) {
if $caller_module_name != $module_name {
fail("Use of private class ${name} by ${caller_module_name}")
Expand Down
2 changes: 1 addition & 1 deletion manifests/userlist.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$config_file = undef,
) {

include haproxy::params
include ::haproxy::params

if $instance == 'haproxy' {
$instance_name = 'haproxy'
Expand Down

0 comments on commit f09238e

Please sign in to comment.