From 3505736fe0041142fdd8ef4e87d0da715ac4a225 Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Sat, 18 Mar 2017 18:06:51 -0500 Subject: [PATCH] stagingapi: project_status_requests() to extract all requests of type. --- osclib/stagingapi.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index 18617a78..5c65e132 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -866,6 +866,14 @@ class StagingAPI(object): tobuild += int(repo['tobuild']) return final, tobuild + def project_status_requests(self, request_type): + key = '{}_requests'.format(request_type) + requests = [] + for status in self.project_status(): + for request in status[key]: + requests.append(str(request['number'])) + return requests + def days_since_last_freeze(self, project): """ Checks the last update for the frozen links