Skip to content

Commit

Permalink
replace validate_integer with datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Mar 23, 2017
1 parent c52ccd1 commit f7fa57b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
38 changes: 18 additions & 20 deletions manifests/bond/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,24 @@
# * Debian Network Bonding http://wiki.debian.org/Bonding
define network::bond::debian(
$slaves,
$ensure = present,
$ipaddress = undef,
$netmask = undef,
$method = undef,
$family = undef,
$onboot = undef,
$hotplug = undef,
$mtu = undef,
$options = undef,
$slave_options = undef,

$mode = undef,
$miimon = undef,
$downdelay = undef,
$updelay = undef,
$lacp_rate = undef,
$primary = undef,
$primary_reselect = undef,
$xmit_hash_policy = undef,
$ensure = present,
$ipaddress = undef,
$netmask = undef,
$method = undef,
$family = undef,
$onboot = undef,
$hotplug = undef,
Optional[Integer[42, 65536]] $mtu = undef,
$options = undef,
$slave_options = undef,
$mode = undef,
$miimon = undef,
$downdelay = undef,
$updelay = undef,
$lacp_rate = undef,
$primary = undef,
$primary_reselect = undef,
$xmit_hash_policy = undef,
) {

$raw = {
Expand All @@ -42,7 +41,6 @@

if $mtu {
# https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1224007
validate_integer([$mtu], 65536, 42)
$raw_post_up = { 'post-up' => "ip link set dev ${name} mtu ${mtu}", }
} else {
$raw_post_up = {}
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/bond/debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
'ipaddress' => '10.20.2.1',
'netmask' => '255.255.255.192',
'slaves' => %w(eth0 eth1 eth2),
'mtu' => '1550',
'mtu' => 1550,
'options' => { 'bond-future-option' => 'yes' },
'slave_options' => { 'slave-future-option' => 'no' },
'hotplug' => 'false',
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/bond_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'ipaddress' => '172.18.1.2',
'netmask' => '255.255.128.0',
'slaves' => %w(eth0 eth1),
'mtu' => '1550',
'mtu' => 1550,
'options' => { 'NM_CONTROLLED' => 'yes' },
'slave_options' => { 'NM_CONTROLLED' => 'no' },

Expand Down

0 comments on commit f7fa57b

Please sign in to comment.