You should be able to run an arbitrary command from within the Vagrantfile 
(its just Ruby) so you could try a 
ping = `ping -c 3 atlas.hashicorp.com || false`
if ping
 <dosomething> 
else 
puts "Proxy or network issue detected, aborting" 
exit 1

This is not valid Ruby (I'm a Python guy mostly) but it gives you a general 
idea.

On Tuesday, April 5, 2016 at 6:58:50 PM UTC-5, Daryl Wood wrote:
>
> Thanks for the reply,
>
> The box fails if it cannot connect to atlas.hashicorp.com, as it should, 
> but I want to handle the error.
>
> On Saturday, April 2, 2016 at 3:16:11 AM UTC-7, Alvaro Miranda Aguilera 
> wrote:
>>
>> Hello
>>
>> if there is no connectivity to download the box, then on vagrant up will 
>> fail.
>>
>> not sure how you can make it fail earlier.
>>
>> Can you describe what you see today ?
>>
>> If someone copy a project of yours, and and then do vagrant up, it should 
>> fail very soon if can't download the box.
>>
>> Thanks
>> Alvaro.
>>
>> On Sat, Apr 2, 2016 at 9:39 AM, Daryl Wood <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I want the vagrantfile script to fail early if the box cannot be 
>>> downloaded due to a proxy or firewall.
>>>
>>> What's the best way to make that happen?
>>>
>>> Thanks
>>>
>>> -- 
>>> This mailing list is governed under the HashiCorp Community Guidelines - 
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>>> violation of those guidelines may result in your removal from this mailing 
>>> list.
>>>  
>>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>>> IRC: #vagrant on Freenode
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Vagrant" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/vagrant-up/49a6f145-fa8a-4232-b435-f3c623e1d30d%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/vagrant-up/49a6f145-fa8a-4232-b435-f3c623e1d30d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/490d3b4c-6069-4f5e-951c-9670fad76eb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to