summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsher256@users.noreply.github.com <Asher256>2016-10-30 22:18:42 -0400
committerAsher256@users.noreply.github.com <Asher256>2016-10-30 22:18:42 -0400
commit61d4cac5c711268ef80e52404c047da2a1f415ca (patch)
treedc62c8e37124d460bc3c0a2bad781e3288da8899
parentfc5c52ce6595784a13e9c114a2ef9b7c9aeaf39a (diff)
downloadgitlab-61d4cac5c711268ef80e52404c047da2a1f415ca.tar.gz
New exception for ProjectKey.enable_deploy_key and disable_deploy_key
-rw-r--r--gitlab/exceptions.py4
-rw-r--r--gitlab/objects.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/gitlab/exceptions.py b/gitlab/exceptions.py
index 733551f..1d1f477 100644
--- a/gitlab/exceptions.py
+++ b/gitlab/exceptions.py
@@ -75,6 +75,10 @@ class GitlabTransferProjectError(GitlabOperationError):
pass
+class GitlabProjectDeployKeyError(GitlabOperationError):
+ pass
+
+
class GitlabCancelError(GitlabOperationError):
pass
diff --git a/gitlab/objects.py b/gitlab/objects.py
index f307156..94b7a7c 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -1253,13 +1253,13 @@ class ProjectKey(GitlabObject):
"""Enable a deploy key for a project."""
url = '/projects/%s/deploy_keys/%s/enable' % (project_id, key_id)
r = self.gitlab._raw_post(url)
- raise_error_from_response(r, GitlabBuildRetryError, 201)
+ raise_error_from_response(r, GitlabProjectDeployKeyError, 201)
def disable_deploy_key(self, project_id, key_id):
"""Disable a deploy key for a project."""
url = '/projects/%s/deploy_keys/%s/disable' % (project_id, key_id)
r = self.gitlab._raw_delete(url)
- raise_error_from_response(r, GitlabBuildRetryError, 201)
+ raise_error_from_response(r, GitlabProjectDeployKeyError, 201)
class ProjectKeyManager(BaseManager):