providers/hyperv: public_address cap
This commit is contained in:
parent
adc8151a4a
commit
074ea02b82
|
@ -0,0 +1,15 @@
|
|||
module VagrantPlugins
|
||||
module Share
|
||||
module Cap
|
||||
class VirtualBox
|
||||
def self.public_address(machine)
|
||||
return nil if machine.state.id != :running
|
||||
|
||||
ssh_info = machine.ssh_info
|
||||
return nil if !ssh_info
|
||||
ssh_info[:host]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -22,6 +22,11 @@ module VagrantPlugins
|
|||
Config
|
||||
end
|
||||
|
||||
provider_capability("hyperv", "public_address") do
|
||||
require_relative "cap/public_address"
|
||||
Cap::PublicAddress
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def self.init!
|
||||
|
|
|
@ -77,6 +77,8 @@ module VagrantPlugins
|
|||
if env[:machine_ssh_info]
|
||||
env[:machine_ssh_info].merge!(:port => 22)
|
||||
end
|
||||
|
||||
env[:machine_ssh_info]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue