From 079327141d3701699d98c03a71d9ad77215dd73c Mon Sep 17 00:00:00 2001 From: hakkeroid Date: Mon, 17 Oct 2016 13:21:21 +0200 Subject: [PATCH] Fix ProjectBuild.play raises error on success Running play on ProjectBuild raises a GitlabBuildPlayError although the request was successful. It looks like gitlab returns a 200-OK instead of 201-CREATED response and as such always raises an exception. --- gitlab/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/objects.py b/gitlab/objects.py index e61483a93..d7688d053 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -965,7 +965,7 @@ def play(self, **kwargs): """Trigger a build explicitly.""" url = '/projects/%s/builds/%s/play' % (self.project_id, self.id) r = self.gitlab._raw_post(url) - raise_error_from_response(r, GitlabBuildPlayError, 201) + raise_error_from_response(r, GitlabBuildPlayError) def erase(self, **kwargs): """Erase the build (remove build artifacts and trace)."""