Sha256: a79bb4709802633f53f8e391eb0028718097fc305fbb9e3333c9e21fe1bb5cd8

Contents?: true

Size: 1.22 KB

Versions: 12

Compression:

Stored size: 1.22 KB

Contents

module VagrantPlugins
  module Kernel_V2
    class SSHConnectConfig < Vagrant.plugin("2", :config)
      attr_accessor :host
      attr_accessor :port
      attr_accessor :private_key_path
      attr_accessor :username

      def initialize
        @host             = UNSET_VALUE
        @port             = UNSET_VALUE
        @private_key_path = UNSET_VALUE
        @username         = UNSET_VALUE
      end

      def finalize!
        @host             = nil if @host == UNSET_VALUE
        @port             = nil if @port == UNSET_VALUE
        @private_key_path = nil if @private_key_path == UNSET_VALUE
        @username         = nil if @username == UNSET_VALUE
      end

      # NOTE: This is _not_ a valid config validation method, since it
      # returns an _array_ of strings rather than a Hash. This is meant to
      # be used with a subclass that handles this.
      #
      # @return [Array<String>]
      def validate(machine)
        errors = _detected_errors

        if @private_key_path && \
          !File.file?(File.expand_path(@private_key_path, machine.env.root_path))
          errors << I18n.t("vagrant.config.ssh.private_key_missing", :path => @private_key_path)
        end

        errors
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/plugins/kernel_v2/config/ssh_connect.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/plugins/kernel_v2/config/ssh_connect.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/plugins/kernel_v2/config/ssh_connect.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/plugins/kernel_v2/config/ssh_connect.rb
tnargav-1.3.6 plugins/kernel_v2/config/ssh_connect.rb
tnargav-1.3.3 plugins/kernel_v2/config/ssh_connect.rb
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/kernel_v2/config/ssh_connect.rb
tnargav-1.2.3 plugins/kernel_v2/config/ssh_connect.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/kernel_v2/config/ssh_connect.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/plugins/kernel_v2/config/ssh_connect.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/plugins/kernel_v2/config/ssh_connect.rb
tnargav-1.2.2 plugins/kernel_v2/config/ssh_connect.rb