core: Move WaitForCommunicator to backports and make it generic
This commit is contained in:
parent
f5661280bc
commit
4fbd7c0182
2 changed files with 6 additions and 7 deletions
|
@ -1,12 +1,11 @@
|
|||
# This acts like a backport of Vagrant's built in action from 1.3+ for older versions
|
||||
# and will probably be deprecated on 0.8+
|
||||
# This acts like a backport of Vagrant's built in action from 1.3+ for previous version
|
||||
# https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/action/builtin/wait_for_communicator.rb
|
||||
module Vagrant
|
||||
module LXC
|
||||
module Backports
|
||||
module Action
|
||||
class WaitForCommunicator
|
||||
def initialize(app, env)
|
||||
@app = app
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
|
@ -21,7 +20,7 @@ module Vagrant
|
|||
max_tries = @env[:machine].config.ssh.max_tries.to_i
|
||||
max_tries.times do |i|
|
||||
if @env[:machine].communicate.ready?
|
||||
@env[:ui].info I18n.t("vagrant_lxc.messages.container_ready")
|
||||
@env[:ui].info 'Machine booted and ready!'
|
||||
return true
|
||||
end
|
||||
|
||||
|
@ -39,3 +38,5 @@ module Vagrant
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
Vagrant::Action::Builtin.const_set :WaitForCommunicator, Vagrant::Backports::Action::WaitForCommunicator
|
|
@ -15,8 +15,6 @@ en:
|
|||
# TODO: Remove the following keys after we drop support for vagrant < 1.3
|
||||
waiting_for_start: |-
|
||||
Waiting for container to start. This should not take long.
|
||||
container_ready: |-
|
||||
Container started and ready for use!
|
||||
warn_networks: |-
|
||||
Warning! The LXC provider doesn't support any of the Vagrant public / private
|
||||
network configurations (ex: `config.vm.network :private_network, ip: "some-ip"`).
|
||||
|
|
Loading…
Reference in a new issue