providers/hyperv: public_address cap

This commit is contained in:
Mitchell Hashimoto 2014-03-06 11:01:19 -08:00
parent adc8151a4a
commit 074ea02b82
3 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -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!

View File

@ -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