Skip to content

Commit 61d4cac

Browse files
Asher256@users.noreply.github.comAsher256@users.noreply.github.com
Asher256@users.noreply.github.com
authored and
Asher256@users.noreply.github.com
committed
New exception for ProjectKey.enable_deploy_key and disable_deploy_key
1 parent fc5c52c commit 61d4cac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

gitlab/exceptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ class GitlabTransferProjectError(GitlabOperationError):
7575
pass
7676

7777

78+
class GitlabProjectDeployKeyError(GitlabOperationError):
79+
pass
80+
81+
7882
class GitlabCancelError(GitlabOperationError):
7983
pass
8084

gitlab/objects.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1253,13 +1253,13 @@ def enable_deploy_key(self, project_id, key_id):
12531253
"""Enable a deploy key for a project."""
12541254
url = '/projects/%s/deploy_keys/%s/enable' % (project_id, key_id)
12551255
r = self.gitlab._raw_post(url)
1256-
raise_error_from_response(r, GitlabBuildRetryError, 201)
1256+
raise_error_from_response(r, GitlabProjectDeployKeyError, 201)
12571257

12581258
def disable_deploy_key(self, project_id, key_id):
12591259
"""Disable a deploy key for a project."""
12601260
url = '/projects/%s/deploy_keys/%s/disable' % (project_id, key_id)
12611261
r = self.gitlab._raw_delete(url)
1262-
raise_error_from_response(r, GitlabBuildRetryError, 201)
1262+
raise_error_from_response(r, GitlabProjectDeployKeyError, 201)
12631263

12641264

12651265
class ProjectKeyManager(BaseManager):

0 commit comments

Comments
 (0)