Class: VagrantPlugins::Skytap::Connection::VpnChoice::VPNAttachmentExecution
Overview
To communicate with the guest VM over a VPN, the guest’s network must be both attached and connected to the VPN. The various subclasses perform different REST calls depending on which of these conditions are already met.
Direct Known Subclasses
AttachConnectAndUseExecution, ConnectAndUseExecution, UseExecution
Instance Attribute Summary collapse
-
#attachment ⇒ Object
readonly
Returns the value of attribute attachment.
-
#vpn ⇒ Object
readonly
Returns the value of attribute vpn.
Attributes inherited from Execution
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(env, iface, vpn, attachment = nil) ⇒ VPNAttachmentExecution
constructor
A new instance of VPNAttachmentExecution.
- #message ⇒ Object
Methods inherited from Execution
Constructor Details
#initialize(env, iface, vpn, attachment = nil) ⇒ VPNAttachmentExecution
Returns a new instance of VPNAttachmentExecution.
81 82 83 84 85 |
# File 'lib/vagrant-skytap/connection/vpn_choice.rb', line 81 def initialize(env, iface, vpn, =nil) super @vpn = vpn = end |
Instance Attribute Details
#attachment ⇒ Object (readonly)
Returns the value of attribute attachment.
67 68 69 |
# File 'lib/vagrant-skytap/connection/vpn_choice.rb', line 67 def end |
#vpn ⇒ Object (readonly)
Returns the value of attribute vpn.
67 68 69 |
# File 'lib/vagrant-skytap/connection/vpn_choice.rb', line 67 def vpn @vpn end |
Class Method Details
.make(env, iface, vpn) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/vagrant-skytap/connection/vpn_choice.rb', line 69 def self.make(env, iface, vpn) = iface.(vpn) if .try(:connected?) UseExecution.new(env, iface, vpn, ) elsif ConnectAndUseExecution.new(env, iface, vpn, ) else AttachConnectAndUseExecution.new(env, iface, vpn) end end |
Instance Method Details
#message ⇒ Object
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/vagrant-skytap/connection/vpn_choice.rb', line 87 def "#{verb}: #{vpn.name}".tap do |ret| if vpn.nat_enabled? ret << " " << I18n.t("vagrant_skytap.connections.vpn_attachment.nat_enabled") else ret << " " << I18n.t("vagrant_skytap.connections.vpn_attachment.local_subnet", local_subnet: vpn.local_subnet) end end end |