Completed
Push — master ( 12c38c...211849 )
by Manas
16s
created

RetryBuild   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %
Metric Value
wmc 2
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 14 2
1
import httplib
2
3
from lib.action import CircleCI
4
5
6
class RetryBuild(CircleCI):
7
8
    def run(self, project, build_num):
9
        """
10
        ReRun a specific build in project.
11
        """
12
        path = 'project/%s/%s/retry' % (project, build_num)
13
14
        response = self._perform_request(
15
            path, method='POST'
16
        )
17
18
        if response.status_code != httplib.CREATED:
19
            raise Exception('Project %s not found.' % project)
20
21
        return response.json()
22