diff --git a/lib/vagrant-lxc/action.rb b/lib/vagrant-lxc/action.rb index b699c28..d021009 100644 --- a/lib/vagrant-lxc/action.rb +++ b/lib/vagrant-lxc/action.rb @@ -197,14 +197,9 @@ module Vagrant # is expected to be put into the `:machine_ip` key. def self.action_fetch_ip Builder.new.tap do |b| - b.use Builtin::ConfigValidate - b.use Builtin::Call, Builtin::IsState, :running do |env, b2| - if env[:result] - b2.use FetchIpWithLxcAttach if env[:machine].provider.driver.supports_attach? - b2.use FetchIpFromDnsmasqLeases - else - b2.use Builtin::Message, I18n.t("vagrant_lxc.messages.not_running") - end + b.use Builtin::Call, Builtin::ConfigValidate do |env, b2| + b2.use FetchIpWithLxcAttach if env[:machine].provider.driver.supports_attach? + b2.use FetchIpFromDnsmasqLeases end end end diff --git a/lib/vagrant-lxc/provider.rb b/lib/vagrant-lxc/provider.rb index 85ffd52..286f4d9 100644 --- a/lib/vagrant-lxc/provider.rb +++ b/lib/vagrant-lxc/provider.rb @@ -64,9 +64,9 @@ module Vagrant # 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 + # If the Container is not running then we cannot possibly SSH into it, so # we return nil. - return nil if state == :not_created + return nil if state.id != :running # Run a custom action called "fetch_ip" which does what it says and puts # the IP found into the `:machine_ip` key in the environment.