tries amount of fetching ip is now configurable
This commit is contained in:
parent
2d63603d85
commit
cac4910296
2 changed files with 6 additions and 1 deletions
|
@ -19,9 +19,11 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def assigned_ip(env)
|
def assigned_ip(env)
|
||||||
|
config = env[:machine].provider_config
|
||||||
|
fetch_ip_tries = config.fetch_ip_tries
|
||||||
driver = env[:machine].provider.driver
|
driver = env[:machine].provider.driver
|
||||||
ip = ''
|
ip = ''
|
||||||
retryable(:on => LXC::Errors::ExecuteError, :tries => 20, :sleep => 3) do
|
retryable(:on => LXC::Errors::ExecuteError, :tries => fetch_ip_tries, :sleep => 3) do
|
||||||
unless ip = get_container_ip_from_ip_addr(driver)
|
unless ip = get_container_ip_from_ip_addr(driver)
|
||||||
# retry
|
# retry
|
||||||
raise LXC::Errors::ExecuteError, :command => "lxc-attach"
|
raise LXC::Errors::ExecuteError, :command => "lxc-attach"
|
||||||
|
|
|
@ -18,12 +18,15 @@ module Vagrant
|
||||||
# machine name, set this to :machine
|
# machine name, set this to :machine
|
||||||
attr_accessor :container_name
|
attr_accessor :container_name
|
||||||
|
|
||||||
|
attr_accessor :fetch_ip_tries
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@customizations = []
|
@customizations = []
|
||||||
@backingstore = UNSET_VALUE
|
@backingstore = UNSET_VALUE
|
||||||
@backingstore_options = []
|
@backingstore_options = []
|
||||||
@sudo_wrapper = UNSET_VALUE
|
@sudo_wrapper = UNSET_VALUE
|
||||||
@container_name = UNSET_VALUE
|
@container_name = UNSET_VALUE
|
||||||
|
@fetch_ip_tries = 10
|
||||||
end
|
end
|
||||||
|
|
||||||
# Customize the container by calling `lxc-start` with the given
|
# Customize the container by calling `lxc-start` with the given
|
||||||
|
|
Loading…
Reference in a new issue