diff options
author | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2015-12-30 19:13:10 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2015-12-30 19:13:10 +0100 |
commit | 74dc2acc788fb6e2fdced0561d8959e2a9d0572f (patch) | |
tree | ecfce463bab9855dd52be4d9d9f8a665f65a8204 /gitlab/cli.py | |
parent | c580b1e69868e038ef61080aa6c6b92f112b4891 (diff) | |
download | gitlab-74dc2acc788fb6e2fdced0561d8959e2a9d0572f.tar.gz |
Add a get method for GitlabObject
This change provides a way to implement GET for objects that don't
support it, but support LIST.
It is also a first step to a cleaner API.
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index 1f82498..648da2d 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -170,7 +170,7 @@ def do_list(cls, gl, what, args): def do_get(cls, gl, what, args): - if not cls.canGet: + if cls.canGet is False: die("%s objects can't be retrieved" % what) id = None @@ -178,7 +178,7 @@ def do_get(cls, gl, what, args): id = get_id(cls, args) try: - o = cls(gl, id, **args) + o = cls.get(gl, id, **args) except Exception as e: die("Impossible to get object (%s)" % str(e)) |