Check index for shadow scheduler artifacts before using ActiveData

This commit is contained in:
Andrew Halberstadt 2019-09-04 13:50:33 -04:00
Родитель 788ea3dfbd
Коммит a9648b2d9c
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -333,10 +333,15 @@ class Push:
Returns:
list: All task labels that would have been scheduler or None.
"""
if name not in self._shadow_scheduler_artifacts:
return None
# First look for an index.
url = SHADOW_SCHEDULER_ARTIFACT_URL.format(rev=self.rev, name=name)
r = requests.get(url)
if r.status_code != 200:
if name not in self._shadow_scheduler_artifacts:
return None
r = requests.get(self._shadow_scheduler_artifacts[name])
r = requests.get(self._shadow_scheduler_artifacts[name])
tasks = r.text
return set(tasks.splitlines())