summaryrefslogtreecommitdiff
path: root/gitlab/cli.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2015-09-19 11:56:50 +0200
committerGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2015-09-19 11:56:50 +0200
commit9c58013a269d3da2beec947a152605fc3c926577 (patch)
tree21722a27de45fddc4aa34b35f3c153f8f754ca8a /gitlab/cli.py
parent3270865977fcf5375b0d99e06ef6cf842eb406e9 (diff)
downloadgitlab-9c58013a269d3da2beec947a152605fc3c926577.tar.gz
Fix GET/POST for project files
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r--gitlab/cli.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py
index 68a589f..a1109b6 100644
--- a/gitlab/cli.py
+++ b/gitlab/cli.py
@@ -82,9 +82,10 @@ def populate_sub_parser_by_class(cls, sub_parser):
elif action_name in [GET, DELETE]:
if cls not in [gitlab.CurrentUser]:
- id_attr = cls.idAttr.replace('_', '-')
- sub_parser_action.add_argument("--%s" % id_attr,
- required=True)
+ if cls.getRequiresId:
+ id_attr = cls.idAttr.replace('_', '-')
+ sub_parser_action.add_argument("--%s" % id_attr,
+ required=True)
[sub_parser_action.add_argument("--%s" % x.replace('_', '-'),
required=True)
for x in cls.requiredGetAttrs]
@@ -172,7 +173,7 @@ def do_get(cls, gl, what, args):
die("%s objects can't be retrieved" % what)
id = None
- if cls not in [gitlab.CurrentUser]:
+ if cls not in [gitlab.CurrentUser] and cls.getRequiresId:
id = get_id(cls, args)
try: