Conditions | 3 |
Total Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | |||
9 | def run(self, api_user, repository, deployment_id): |
||
10 | |||
11 | if api_user: |
||
12 | self.token = self._get_user_token(api_user) |
||
13 | |||
14 | payload = {"id": deployment_id} |
||
15 | |||
16 | responses = self._request("GET", |
||
17 | "/repos/{}/deployments/{}/statuses".format( |
||
18 | repository, deployment_id), |
||
19 | payload, |
||
20 | self.token) |
||
21 | results = [] |
||
22 | for response in responses: |
||
23 | ts_created_at = time.mktime( |
||
24 | datetime.datetime.strptime( |
||
25 | response['created_at'], |
||
26 | "%Y-%m-%dT%H:%M:%SZ").timetuple()) |
||
27 | |||
28 | results.append({'creator': response['creator']['login'], |
||
29 | 'id': response['id'], |
||
30 | 'description': response['description'], |
||
31 | 'state': response['state'], |
||
32 | 'description': response['description'], |
||
33 | 'target_url': response['target_url'], |
||
34 | 'created_at': response['created_at'], |
||
35 | 'updated_at': response['updated_at'], |
||
36 | 'ts_created_at': ts_created_at}) |
||
37 | |||
38 | return results |
||
39 |