From eae2edf0635f78b422e1f685db291f41b227b456 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 15 Jan 2014 19:55:07 -0800 Subject: [PATCH] providers/virtualbox: retry list hostonlyifs [GH-2831] --- CHANGELOG.md | 2 ++ plugins/providers/virtualbox/driver/version_4_3.rb | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e40a70297..519609446 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,8 @@ BUG FIXES: - hosts/bsd: Don't invoke shell for NFS sudo calls. [GH-2808] - providers/virtualbox: Enabling internal networks by just setting "true" works properly. [GH-2751] + - providers/virtualbox: Make more internal interactions with VBoxManage + retryable to avoid spurious VirtualBox errors. [GH-2831] - provisioners/chef: When chowning folders, don't follow symlinks. - provisioners/salt: Options can now set install type and install args. [GH-2766] diff --git a/plugins/providers/virtualbox/driver/version_4_3.rb b/plugins/providers/virtualbox/driver/version_4_3.rb index 8e8001351..98fd3799d 100644 --- a/plugins/providers/virtualbox/driver/version_4_3.rb +++ b/plugins/providers/virtualbox/driver/version_4_3.rb @@ -68,7 +68,7 @@ module VagrantPlugins def delete_unused_host_only_networks networks = [] - execute("list", "hostonlyifs").split("\n").each do |line| + execute("list", "hostonlyifs", retryable: true).split("\n").each do |line| networks << $1.to_s if line =~ /^Name:\s+(.+?)$/ end @@ -338,7 +338,7 @@ module VagrantPlugins dhcp[info[:network]] = info end - execute("list", "hostonlyifs", :retryable => true).split("\n\n").collect do |block| + execute("list", "hostonlyifs", retryable: true).split("\n\n").collect do |block| info = {} block.split("\n").each do |line| @@ -521,7 +521,7 @@ module VagrantPlugins def verify! # This command sometimes fails if kernel drivers aren't properly loaded # so we just run the command and verify that it succeeded. - execute("list", "hostonlyifs") + execute("list", "hostonlyifs", retryable: true) end def verify_image(path)