From d04b65928ec9dddf17a7ffc1f237628e6a08d21e Mon Sep 17 00:00:00 2001 From: Laura Nguyen Date: Fri, 3 Sep 2021 14:59:39 -0400 Subject: [PATCH] Changed 'out_of_date' to 'out_of_sync' --- data.json | 102 +++++++++++++++++++++++++++--------------------------- main.py | 14 ++++---- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/data.json b/data.json index 9eefe62..0a932de 100644 --- a/data.json +++ b/data.json @@ -1,176 +1,176 @@ { "AlmaLinux": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "https://repo.almalinux.org/", "file": "almalinux/TIME" }, "Alpine": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "https://uk.alpinelinux.org/", "file": "alpine/last-updated" }, "Apache": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "apache/", "upstream": "https://downloads.apache.org/", "file": "zzz/time.txt" }, "Arch": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "archlinux/", "upstream": "http://arch.mirror.constant.com/", "file": "lastupdate" }, "CentOS": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "https://mirrors.edge.kernel.org/", "file": "centos/TIME" }, "Ceph": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "ceph/", "upstream": "https://download.ceph.com/", "file": "timestamp" }, "CPAN": { - "out_of_date_interval": 172800 + "out_of_sync_interval": 172800 }, "Cygwin": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "cygwin/", "upstream": "https://cygwin.mirror.globo.tech/", "file": "x86/sha512.sum" }, "Debian": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "https://ftp-master.debian.org/", "file": "debian/project/trace/master" }, "DebianCD": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "http://debian.mirror.estruxture.net/", "file": "debian-cd/project/trace/cdimage.debian.org" }, "DebianMultimedia": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "debian-multimedia/", "upstream": "http://debian-mirrors.sdinet.de/deb-multimedia/", "file": "project/trace/deb-multimedia.org" }, "DebianPorts": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "https://deb.debian.org/", "file": "debian-ports/project/trace/porta.debian.org" }, "DebianSecurity": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "http://debian.mirror.iweb.ca/", "file": "debian-security/project/trace/master" }, "Eclipse": { - "out_of_date_since": null, - "out_of_date_interval": 172800, + "out_of_sync_since": null, + "out_of_sync_interval": 172800, "csc": "eclipse/", "upstream": "http://download.eclipse.org/", "file": "TIME" }, "Fedora": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "fedora/", "upstream": "http://fedora.mirror.iweb.com/", "file": "linux/development/rawhide/COMPOSE_ID" }, "FreeBSD": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "http://ftp4.freebsd.org/pub/", "file": "FreeBSD/TIMESTAMP" }, "GentooDistfiles": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "gentoo-distfiles", "upstream": "http://gentoo.mirrors.tera-byte.com/", "file": "distfiles/timestamp.dev-local" }, "GentooPortage": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "rsync://rsync4.ca.gentoo.org/", "upstream1": "rsync://rsync1.de.gentoo.org/", "upstream2": "rsync://rsync8.de.gentoo.org/", "file": "gentoo-portage/Manifest" }, "GNOME": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "upstream1": "https://mirrors.dotsrc.org/", "upstream2": "https://muug.ca/mirror/", "file": "gnome/core/41/41.beta/cache.json" }, "GNU": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "https://mirrors.kernel.org/", "file": "gnu/mirror-updated-timestamp.txt" }, "Gutenberg": { - "out_of_date_since": null, - "out_of_date_interval": 172800, + "out_of_sync_since": null, + "out_of_sync_interval": 172800, "csc": "gutenberg/", "upstream": "https://gutenberg.pglaf.org/", "file": "gutenberg.dcs" }, "IPFire": { - "out_of_date_since": null, - "out_of_date_interval": 172800 + "out_of_sync_since": null, + "out_of_sync_interval": 172800 }, "KDE": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "kde/", "upstream": "https://kde.c3sl.ufpr.br/", "file": "ls-lR" }, "KDEApplicationData": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "kde-applicationdata/", "upstream": "https://cdn.files.kde.org/", "file": "last-updated" }, "Kernel": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "kernel.org/", "upstream": "https://mirrors.edge.kernel.org/pub/", "file": "linux/kernel/next/sha256sums.asc" }, "OpenBSD": { - "out_of_date_since": null, - "out_of_date_interval": 86400, + "out_of_sync_since": null, + "out_of_sync_interval": 86400, "csc": "", "upstream": "https://ftp.openbsd.org/pub/", "file": "OpenBSD/timestamp" diff --git a/main.py b/main.py index eb462ad..6de60ca 100644 --- a/main.py +++ b/main.py @@ -114,7 +114,7 @@ if __name__ == "__main__": for mirror in res_json: if mirror["url"] == f"{CSC_MIRROR}CPAN/": if current_time - int(mirror["age"]) \ - > data[distro]["out_of_date_interval"]: + > data[distro]["out_of_sync_interval"]: print(f"Failure: {distro} out-of-sync") else: print(f"Success: {distro} up-to-date") @@ -129,7 +129,7 @@ if __name__ == "__main__": if line_count == 49: checker_result = gnome_checker(data, distro) else: - data[distro]["out_of_date_since"] = None + data[distro]["out_of_sync_since"] = None print(f"Failure: {distro} should check for latest version") continue elif distro == "IPFire": @@ -137,11 +137,11 @@ if __name__ == "__main__": else: checker_result = general_checker(data, distro) if checker_result: - data[distro]["out_of_date_since"] = None - elif data[distro]["out_of_date_since"] is None: - data[distro]["out_of_date_since"] = current_time - elif current_time - data[distro]["out_of_date_since"] \ - > data[distro]["out_of_date_interval"]: + data[distro]["out_of_sync_since"] = None + elif data[distro]["out_of_sync_since"] is None: + data[distro]["out_of_sync_since"] = current_time + elif current_time - data[distro]["out_of_sync_since"] \ + > data[distro]["out_of_sync_interval"]: print(f"Failure: {distro} out-of-sync") continue print(f"Success: {distro} up-to-date")