From 3e73a85d5295a914321f07f57980f632b6effd86 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Mon, 8 Jul 2013 13:05:29 -0300 Subject: [PATCH] Enable retries when fetching container state Fixes #74 --- lib/vagrant-lxc/driver/cli.rb | 2 +- spec/unit/driver/cli_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-lxc/driver/cli.rb b/lib/vagrant-lxc/driver/cli.rb index 133a828..b7ed4fe 100644 --- a/lib/vagrant-lxc/driver/cli.rb +++ b/lib/vagrant-lxc/driver/cli.rb @@ -39,7 +39,7 @@ module Vagrant end def state - if @name && run(:info, '--name', @name) =~ /^state:[^A-Z]+([A-Z]+)$/ + if @name && run(:info, '--name', @name, retryable: true) =~ /^state:[^A-Z]+([A-Z]+)$/ $1.downcase.to_sym elsif @name :unknown diff --git a/spec/unit/driver/cli_spec.rb b/spec/unit/driver/cli_spec.rb index 3498b6a..5080fb2 100644 --- a/spec/unit/driver/cli_spec.rb +++ b/spec/unit/driver/cli_spec.rb @@ -126,7 +126,7 @@ describe Vagrant::LXC::Driver::CLI do it 'calls lxc-info with the right arguments' do subject.state - subject.should have_received(:run).with(:info, '--name', name) + subject.should have_received(:run).with(:info, '--name', name, retryable: true) end it 'maps the output of lxc-info status out to a symbol' do