Sha256: cfb966042964b762eb1a828372b8e440486fe46314389a2070aecb7b187dfb6a

Contents?: true

Size: 967 Bytes

Versions: 9

Compression:

Stored size: 967 Bytes

Contents

require 'vagrant/util/scoped_hash_override'

module VagrantPlugins
  module VCloud
    module Util
      module CompileForwardedPorts
        include Vagrant::Util::ScopedHashOverride

        # This method compiles the forwarded ports into {ForwardedPort}
        # models.
        def compile_forwarded_ports(config)
          mappings = {}

          config.vm.networks.each do |type, options|
            if type == :forwarded_port
              guest_port = options[:guest]
              host_port  = options[:host]
              options    = scoped_hash_override(options, :vcloud)
              id         = options[:id]

              # skip forwarded rules already found in handle_nat_port_collisions
              next if options[:already_exists]

              mappings[host_port] =
                Model::ForwardedPort.new(id, host_port, guest_port, options)
            end
          end

          mappings.values
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vagrant-vcloud-0.4.4 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.4.3 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.4.2 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.4.1 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.4.0 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.3.3 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.3.2 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.3.1 lib/vagrant-vcloud/util/compile_forwarded_ports.rb
vagrant-vcloud-0.3.0 lib/vagrant-vcloud/util/compile_forwarded_ports.rb