From c0b2cc68d5081053709fe98ffa4f3fe60329ac7f Mon Sep 17 00:00:00 2001 From: Stuart Browne Date: Thu, 26 Jul 2018 03:58:29 +0000 Subject: [PATCH] Fix the path to the 'latest' measurements. Also value check the passed argument to ensure it is in the documented range (less than 10). --- RIPEAtlas.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RIPEAtlas.py b/RIPEAtlas.py index 317d1d2..0d14a8b 100644 --- a/RIPEAtlas.py +++ b/RIPEAtlas.py @@ -110,7 +110,7 @@ def __init__(self, data, wait=True, sleep_notification=None, key=None, id=None): self.url_status = base_url + "/%s/?fields=status" self.url_results = base_url + "/%s/results/" self.url_all = base_url + "/%s/" - self.url_latest = base_url + "-latest/%s/?versions=%s" + self.url_latest = base_url + "/%s/latest/?versions=%s" self.status = None @@ -216,6 +216,8 @@ def results(self, wait=True, percentage_required=0.9, latest=None): """ if latest is not None: wait = False + if latest < 1 or latest > 10: + raise IncompatibleArguments("Latest can only be a value between 1 and 10. %s is out of that range." % latest) if latest is None: request = JsonRequest(self.url_results % self.id) else: