| Total Complexity | 1 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| 1 | import json |
||
| 6 | class EnableHookAction(TravisCI): |
||
| 7 | def run(self, hook_id): |
||
| 8 | """ |
||
| 9 | Enable a hook to monitor through Travis |
||
| 10 | """ |
||
| 11 | path = '/hooks/' + str(hook_id) |
||
| 12 | json_req = { |
||
| 13 | 'hook': { |
||
| 14 | 'active': 'true' |
||
| 15 | } |
||
| 16 | } |
||
| 17 | json_req = json.dumps(json_req) |
||
| 18 | response = self._perform_request(path, data=json_req, method='PUT') |
||
| 19 | return response.content |
||
| 20 |