Make able to work prefetch without OVS

Change-Id: I92d43b290b0d8bdfaa8b9c48bf61fdf3a98ae8aa
Related-bug: #1516060
This commit is contained in:
Sergey Vasilenko
2015-11-18 16:05:13 +03:00
parent fcd57d9107
commit ef8a8c19e4
4 changed files with 7 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ Puppet::Type.type(:l2_bond).provide(:ovs, :parent => Puppet::Provider::Ovs_base)
def self.get_instances(big_hash)
# didn't use .select{...} here for backward compatibility with ruby 1.8
big_hash[:port].reject{|k,v| !v[:port_type].include?('bond')}
big_hash.fetch(:port, {}).reject{|k,v| !v[:port_type].include?('bond')}
end
#-----------------------------------------------------------------

View File

@@ -10,7 +10,7 @@ Puppet::Type.type(:l2_bridge).provide(:ovs, :parent => Puppet::Provider::Ovs_bas
end
def self.get_instances(big_hash)
big_hash[:bridge]
big_hash.fetch(:bridge, {})
end
# def self.instances

View File

@@ -6,13 +6,16 @@ Puppet::Type.type(:l2_patch).provide(:ovs, :parent => Puppet::Provider::Ovs_base
:ethtool_cmd => 'ethtool',
:brctl => 'brctl'
def self.get_instances(big_hash)
big_hash.fetch(:port, {})
end
def self.instances
vsctl_show = ovs_vsctl_show()
lnx_port_br_mapping = get_lnx_port_bridges_pairs()
jacks = []
# didn't use .select{...} here for backward compatibility with ruby 1.8
vsctl_show[:port].reject{|k,v| !(v[:port_type] & ['jack','internal']).any?}.each_pair do |p_name, p_props|
vsctl_show.fetch(:port,{}).reject{|k,v| !(v[:port_type] & ['jack','internal']).any?}.each_pair do |p_name, p_props|
props = {
:name => p_name,
}

View File

@@ -12,7 +12,7 @@ Puppet::Type.type(:l2_port).provide(:ovs, :parent => Puppet::Provider::Ovs_base)
end
def self.get_instances(big_hash)
big_hash[:port]
big_hash.fetch(:port, {})
end
#-----------------------------------------------------------------