From bcb3b6c21b84d8d4e24d33aa92aff9b6fa31e285 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 13 Nov 2017 20:35:12 +0100 Subject: Fix: sort list of returned builds --- ick2/controllerapi.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ick2/controllerapi.py') diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index a9a97e9..fd68a84 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -246,6 +246,13 @@ class BuildsAPI(ResourceApiBase): # pragma: no cover def update(self, body, name): # pragma: no cover raise MethodNotAllowed('Updating builds directly is not allowed') + def list(self): + result = super().list() + items = result[self._type_name] + items.sort(key=lambda x: x.get('build_id')) + result[self._type_name] = items + return result + class LogAPI(ResourceApiBase): # pragma: no cover -- cgit v1.2.1