Class: Vagrant::Config::SSHConfig
- Defined in:
- lib/vagrant/config/ssh.rb
Instance Attribute Summary collapse
-
#forward_agent ⇒ Object
Returns the value of attribute forward_agent.
-
#forward_x11 ⇒ Object
Returns the value of attribute forward_x11.
-
#guest_port ⇒ Object
Returns the value of attribute guest_port.
-
#host ⇒ Object
Returns the value of attribute host.
-
#max_tries ⇒ Object
Returns the value of attribute max_tries.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#private_key_path ⇒ Object
Returns the value of attribute private_key_path.
-
#shell ⇒ Object
Returns the value of attribute shell.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
Methods inherited from Base
#instance_variables_hash, json_create, #merge, #set_options, #to_hash, #to_json
Instance Attribute Details
#forward_agent ⇒ Object
Returns the value of attribute forward_agent.
12 13 14 |
# File 'lib/vagrant/config/ssh.rb', line 12 def forward_agent @forward_agent end |
#forward_x11 ⇒ Object
Returns the value of attribute forward_x11.
13 14 15 |
# File 'lib/vagrant/config/ssh.rb', line 13 def forward_x11 @forward_x11 end |
#guest_port ⇒ Object
Returns the value of attribute guest_port.
8 9 10 |
# File 'lib/vagrant/config/ssh.rb', line 8 def guest_port @guest_port end |
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/vagrant/config/ssh.rb', line 6 def host @host end |
#max_tries ⇒ Object
Returns the value of attribute max_tries.
9 10 11 |
# File 'lib/vagrant/config/ssh.rb', line 9 def max_tries @max_tries end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/vagrant/config/ssh.rb', line 5 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/vagrant/config/ssh.rb', line 7 def port @port end |
#private_key_path ⇒ Object
Returns the value of attribute private_key_path.
11 12 13 |
# File 'lib/vagrant/config/ssh.rb', line 11 def private_key_path @private_key_path end |
#shell ⇒ Object
Returns the value of attribute shell.
14 15 16 |
# File 'lib/vagrant/config/ssh.rb', line 14 def shell @shell end |
#timeout ⇒ Object
Returns the value of attribute timeout.
10 11 12 |
# File 'lib/vagrant/config/ssh.rb', line 10 def timeout @timeout end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/vagrant/config/ssh.rb', line 4 def username @username end |
Instance Method Details
#validate(env, errors) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/vagrant/config/ssh.rb', line 16 def validate(env, errors) [:username, :host, :max_tries, :timeout].each do |field| errors.add(I18n.t("vagrant.config.common.error_empty", :field => field)) if !instance_variable_get("@#{field}".to_sym) end if private_key_path && !File.file?(File.(private_key_path, env.root_path)) errors.add(I18n.t("vagrant.config.ssh.private_key_missing", :path => private_key_path)) end end |