Merge "Fix idempotency with mtu for lnx l2_port and l2_bond"

This commit is contained in:
Jenkins
2016-02-11 17:05:43 +00:00
committed by Gerrit Code Review

View File

@@ -66,6 +66,7 @@ class Puppet::Provider::L2_base < Puppet::Provider::InterfaceToolset
:mtu => File.open("#{if_dir}/mtu").read.chomp.to_i, :mtu => File.open("#{if_dir}/mtu").read.chomp.to_i,
:provider => (if_name == 'ovs-system') ? 'ovs' : 'lnx' , :provider => (if_name == 'ovs-system') ? 'ovs' : 'lnx' ,
} }
port[if_name][:mtu] = :absent if port[if_name][:mtu] == 1500
# determine port_type for this iface # determine port_type for this iface
peer_ifindex = self.get_iface_peer_index(if_name) peer_ifindex = self.get_iface_peer_index(if_name)
if !peer_ifindex.nil? if !peer_ifindex.nil?
@@ -517,6 +518,7 @@ class Puppet::Provider::L2_base < Puppet::Provider::InterfaceToolset
:downdelay => File.open("/sys/class/net/#{bond_name}/bonding/downdelay").read.chomp, :downdelay => File.open("/sys/class/net/#{bond_name}/bonding/downdelay").read.chomp,
} }
} }
bond[bond_name][:mtu] = :absent if port[if_name][:mtu] == 1500
if ['802.3ad', 'balance-xor', 'balance-tlb', 'balance-alb'].include? mode if ['802.3ad', 'balance-xor', 'balance-tlb', 'balance-alb'].include? mode
xmit_hash_policy = File.open("/sys/class/net/#{bond_name}/bonding/xmit_hash_policy").read.split(/\s+/)[0] xmit_hash_policy = File.open("/sys/class/net/#{bond_name}/bonding/xmit_hash_policy").read.split(/\s+/)[0]
bond[bond_name][:bond_properties][:xmit_hash_policy] = xmit_hash_policy bond[bond_name][:bond_properties][:xmit_hash_policy] = xmit_hash_policy