From 4fbd7c01822638cfa36518cbda8eca18e572a5b0 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Tue, 11 Mar 2014 20:49:59 -0300 Subject: [PATCH] core: Move WaitForCommunicator to backports and make it generic --- .../action/wait_for_communicator.rb | 11 ++++++----- locales/en.yml | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) rename lib/{vagrant-lxc => vagrant-backports}/action/wait_for_communicator.rb (81%) diff --git a/lib/vagrant-lxc/action/wait_for_communicator.rb b/lib/vagrant-backports/action/wait_for_communicator.rb similarity index 81% rename from lib/vagrant-lxc/action/wait_for_communicator.rb rename to lib/vagrant-backports/action/wait_for_communicator.rb index 9f8b72f..39b349b 100644 --- a/lib/vagrant-lxc/action/wait_for_communicator.rb +++ b/lib/vagrant-backports/action/wait_for_communicator.rb @@ -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 diff --git a/locales/en.yml b/locales/en.yml index 2958b99..84a15a9 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -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"`).