Skip to content

Commit

Permalink
Parse resource data into the keys that net-ip expect
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hollinger committed May 29, 2018
1 parent f62041e commit d076eb6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/puppet/provider/network_route/network_route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,24 @@ def get(_context)
}.compact!
end
end

def puppet_munge(should)
should.delete(:ensure)
if should[:default_route]
should[:prefix] = 'default'
should.delete(:default_route)
should.delete(:prefix)
else
should[:prefix] = should.delete(:prefix)
end
should[:via] = should.delete(:gateway) if should[:gateway]
should[:dev] = should.delete(:interface) if should[:interface]
should[:metric] = should.delete(:metric)
should[:table] = should.delete(:table)
should[:src] = should.delete(:source) if should[:source]
should[:scope] = should.delete(:scope)
should[:proto] = should.delete(:protocol)
should[:mtu] = should.delete(:mtu) if should[:mtu]
should
end
end

0 comments on commit d076eb6

Please sign in to comment.