File: get_ext_net_name.rb

package info (click to toggle)
puppet-module-murano 23.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 928 kB
  • sloc: ruby: 2,856; python: 38; sh: 10; makefile: 10
file content (9 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
Puppet::Functions.create_function(:get_ext_net_name) do
  def get_ext_net_name(*args)
    networks = args.first
    raise(Puppet::ParseError, 'get_ext_net_name(): No network data provided!') unless networks.is_a? Hash
    ext_net_array = networks.find { |_, value| value.fetch('L2', {})['router_ext'] }
    return nil unless ext_net_array
    ext_net_array.first
  end
end