diff options
| author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-03-17 17:39:20 +0100 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-03-17 17:39:20 +0100 |
| commit | a3f2ab138502cf3217d1b97ae7f3cd3a4f8b324f (patch) | |
| tree | 4c367da925afe228d83d61601fdf0af9b3a17b13 /gitlab | |
| parent | ea0759d71c6678b8ce65791535a9be1675d9cfab (diff) | |
| download | gitlab-a3f2ab138502cf3217d1b97ae7f3cd3a4f8b324f.tar.gz | |
Add DeployKey{,Manager} classes
They are the same as Key and KeyManager but the name makes more sense.
Fixes #212
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/__init__.py | 1 | ||||
| -rw-r--r-- | gitlab/objects.py | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 119dab0..cce282d 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -91,6 +91,7 @@ class Gitlab(object): self.broadcastmessages = BroadcastMessageManager(self) self.keys = KeyManager(self) + self.deploykeys = DeployKeyManager(self) self.gitlabciymls = GitlabciymlManager(self) self.gitignores = GitignoreManager(self) self.groups = GroupManager(self) diff --git a/gitlab/objects.py b/gitlab/objects.py index 3c38e8e..f067657 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -802,11 +802,28 @@ class Key(GitlabObject): canUpdate = False canDelete = False + def __init__(self, *args, **kwargs): + warnings.warn("`Key` is deprecated, use `DeployKey` instead", + DeprecationWarning) + super(Key, self).__init__(*args, **kwargs) + class KeyManager(BaseManager): obj_cls = Key +class DeployKey(GitlabObject): + _url = '/deploy_keys' + canGet = 'from_list' + canCreate = False + canUpdate = False + canDelete = False + + +class DeployKeyManager(BaseManager): + obj_cls = DeployKey + + class NotificationSettings(GitlabObject): _url = '/notification_settings' _id_in_update_url = False |
