Commit 0b4b9fb4 authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Catch HTTP timeouts

parent 4e4a7a79
......@@ -9,11 +9,17 @@ deb-src <%= @debmirror_url %> <%= @codename %> main contrib non-free
# This is not the case for Squeeze at archive.d.o, therefore
# real-life check if we can retrieve this Release:
uri = URI("#{@debmirror_url}-security/dists/#{@codename}/updates/Release")
if Net::HTTP.get_response(uri).class == Net::HTTPOK
begin
if Net::HTTP.get_response(uri).class == Net::HTTPOK
-%>
deb <%= @debmirror_url %>-security <%= @codename %>/updates main contrib non-free
deb-src <%= @debmirror_url %>-security <%= @codename %>/updates main contrib non-free
<%- end -%>
<%-
end
rescue Timeout::Error => e
Chef::Log.warn "Cannot connect to #{uri}: #{e}"
end
-%>
<% @additional_sources.each do |repo| -%>
<%= repo %>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment