Sha256: dd2fd7a031e4c5378abc689b1d3de555de1b17f489a605496019c8d705159819

Contents?: true

Size: 997 Bytes

Versions: 7

Compression:

Stored size: 997 Bytes

Contents

require "vagrant"

module VagrantPlugins
  module Kernel_V2
    class SSHConfig < Vagrant.plugin("2", :config)
      attr_accessor :username
      attr_accessor :host
      attr_accessor :port
      attr_accessor :guest_port
      attr_accessor :max_tries
      attr_accessor :timeout
      attr_accessor :private_key_path
      attr_accessor :forward_agent
      attr_accessor :forward_x11
      attr_accessor :shell

      def validate(machine)
        errors = []

        [:username, :max_tries, :timeout].each do |field|
          value = instance_variable_get("@#{field}".to_sym)
          errors << I18n.t("vagrant.config.common.error_empty", :field => field) if !value
        end

        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

        # Return the errors
        { "ssh" => errors }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
vagrantup-1.1.3 plugins/kernel_v2/config/ssh.rb
vagrantup-1.1.2 plugins/kernel_v2/config/ssh.rb
vagrantup-1.1.1 plugins/kernel_v2/config/ssh.rb
vagrantup-1.1.0 plugins/kernel_v2/config/ssh.rb
vagrantup-1.1.4 plugins/kernel_v2/config/ssh.rb
vagrant-actionio-0.0.9 vendor/bundle/bundler/gems/vagrant-c74251a1d9c0/plugins/kernel_v2/config/ssh.rb
vagrant-lxc-0.0.1 vendor/vagrant/plugins/kernel_v2/config/ssh.rb