From 22e5a48af5584c4754b0bae29f2b6ed3df93bfa1 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 2 Mar 2013 16:45:14 -0300 Subject: [PATCH] Add ssh_info to provider --- lib/vagrant-lxc/provider.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/vagrant-lxc/provider.rb b/lib/vagrant-lxc/provider.rb index 783d6d0..43f6a63 100644 --- a/lib/vagrant-lxc/provider.rb +++ b/lib/vagrant-lxc/provider.rb @@ -45,6 +45,18 @@ module Vagrant nil end + # Returns the SSH info for accessing the Container. + def ssh_info + # If the Container is not created then we cannot possibly SSH into it, so + # we return nil. + return nil if state == :not_created + + { + :host => @container.dhcp_ip, + :port => 22 # @driver.ssh_port(@machine.config.ssh.guest_port) + } + end + def state state_id = nil state_id = :not_created if !@container.name