Sha256: d5fe2f53e7d02d52b6034180464c8ad8f519a0914822b4452ed356e4fe9e7c82

Contents?: true

Size: 1.2 KB

Versions: 17

Compression:

Stored size: 1.2 KB

Contents

module VagrantPlugins
  module ProviderVirtualBox
    module Cap
      # Reads the forwarded ports that currently exist on the machine
      # itself. This raises an exception if the machine isn't running.
      #
      # This also may not match up with configured forwarded ports, because
      # Vagrant auto port collision fixing may have taken place.
      #
      # @return [Hash<Integer, Integer>] Host => Guest port mappings.
      def self.forwarded_ports(machine)
        return nil if machine.state.id != :running

        {}.tap do |result|
          machine.provider.driver.read_forwarded_ports.each do |_, _, h, g|
            result[h] = g
          end
        end
      end

      # Reads the network interface card MAC addresses and returns them.
      #
      # @return [Hash<String, String>] Adapter => MAC address
      def self.nic_mac_addresses(machine)
        machine.provider.driver.read_mac_addresses
      end

      # Returns a list of the snapshots that are taken on this machine.
      #
      # @return [Array<String>] Snapshot Name
      def self.snapshot_list(machine)
        return [] if machine.id.nil?
        machine.provider.driver.list_snapshots(machine.id)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/providers/virtualbox/cap.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.3.3.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.3.2.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.19.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.18.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.16.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.14.0 plugins/providers/virtualbox/cap.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.10.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.9.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.8.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.7.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.6.2 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.6.1 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.6.0 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.2.5.0 plugins/providers/virtualbox/cap.rb