def __init__(self): self.url = "https://cfengine.com/release-data/enterprise/releases.json" self.data = get_json(self.url) self.supported_branches = [] for branch in self.data["lts_branches"]: expires = branch["supported_until"] expires += "-25" # Branch expires 25th day of month # This is exact enough and avoids problems with leap years if not is_in_past(expires): self.supported_branches.append(branch["branch_name"]) else: log.info("LTS branch {} expired on {}".format(branch["branch_name"], expires)) self.releases = [] for release in self.data["releases"]: rel = Release(release) if "status" in release and release["status"] == "unsupported": continue if "lts_branch" not in release and "latest_stable" not in release: continue if "lts_branch" in release and release["lts_branch"] not in self.supported_branches: continue if "latestLTS" in release and release["latestLTS"] == True: self.default = rel rel.default = True self.releases.append(rel)