aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mga-mirrors/files
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2020-06-28 21:12:09 +0000
committerPascal Terjan <pterjan@mageia.org>2020-06-28 21:12:09 +0000
commitebe5bf289480444171ea742a51d39c0c16c7da41 (patch)
tree5cb65d26b2be509b30c513891af6dc9c83d791ac /modules/mga-mirrors/files
parent05c01c358cfac28061ef0f028f25c408e02487ed (diff)
downloadpuppet-ebe5bf289480444171ea742a51d39c0c16c7da41.tar
puppet-ebe5bf289480444171ea742a51d39c0c16c7da41.tar.gz
puppet-ebe5bf289480444171ea742a51d39c0c16c7da41.tar.bz2
puppet-ebe5bf289480444171ea742a51d39c0c16c7da41.tar.xz
puppet-ebe5bf289480444171ea742a51d39c0c16c7da41.zip
Fix mirror age colouring
Diffstat (limited to 'modules/mga-mirrors/files')
-rwxr-xr-xmodules/mga-mirrors/files/check_mirrors_status8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/mga-mirrors/files/check_mirrors_status b/modules/mga-mirrors/files/check_mirrors_status
index 0e23eeca..027457d9 100755
--- a/modules/mga-mirrors/files/check_mirrors_status
+++ b/modules/mga-mirrors/files/check_mirrors_status
@@ -76,7 +76,11 @@ def timestamp_url(url)
end
def get_timestamp(url)
- DateTime.strptime(fetch_url(timestamp_url(url)).to_i.to_s, '%s')
+ ti = fetch_url(timestamp_url(url)).to_i
+ if ti == 0 then
+ return nil
+ end
+ return DateTime.strptime(ti.to_s, '%s')
end
def parse_version(version)
@@ -95,7 +99,7 @@ end
def format_age(ref_time, time)
return " <td class='broken'>X</td>" unless time
- diff = time - ref_time
+ diff = ref_time - time
cls = nil
if diff == 0 then
cls = 'ok'