diff options
author | Pascal Terjan <pterjan@mageia.org> | 2017-12-22 13:10:54 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2017-12-22 13:10:54 +0000 |
commit | a57cde419ee49e5f4074a7274f7a412dcc62fcab (patch) | |
tree | c46770b44967f4ad8e1761dc40e5404dcafc905f /modules/mga-mirrors | |
parent | c2be24022d79d26b185a49845543c78d6e2c74a6 (diff) | |
download | puppet-a57cde419ee49e5f4074a7274f7a412dcc62fcab.tar puppet-a57cde419ee49e5f4074a7274f7a412dcc62fcab.tar.gz puppet-a57cde419ee49e5f4074a7274f7a412dcc62fcab.tar.bz2 puppet-a57cde419ee49e5f4074a7274f7a412dcc62fcab.tar.xz puppet-a57cde419ee49e5f4074a7274f7a412dcc62fcab.zip |
Log URLs we fail to fetch from reference mirror
Diffstat (limited to 'modules/mga-mirrors')
-rwxr-xr-x | modules/mga-mirrors/files/check_mirrors_status | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/mga-mirrors/files/check_mirrors_status b/modules/mga-mirrors/files/check_mirrors_status index 7e902549..602ab163 100755 --- a/modules/mga-mirrors/files/check_mirrors_status +++ b/modules/mga-mirrors/files/check_mirrors_status @@ -15,6 +15,7 @@ def get_dates(base, archs_per_distro, optional=true) r[d][a] = get_date(base, d, a) rescue Net::OpenTimeout, Timeout::Error, ArgumentError, NoMethodError, Errno::EHOSTUNREACH => e if !optional then + STDERR.puts "Failed to fetch #{version_url(url, distrib, arch)}" raise end end @@ -68,8 +69,12 @@ def parse_version(version) DateTime.strptime(date, '%Y%m%d %H:%M') end +def version_url(url, distrib, arch) + "#{url}/distrib/#{distrib}/#{arch}/VERSION" +end + def get_date(url, distrib, arch) - return parse_version(fetch_url("#{url}/distrib/#{distrib}/#{arch}/VERSION")) + return parse_version(fetch_url(version_url(url, distrib, arch))) end def print_output(archs_per_distro, mirrors, ref_times, times) |