summaryrefslogtreecommitdiff
path: root/gitlab/cli.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-12-25 07:40:07 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2016-12-25 07:40:07 +0100
commitb05c0b67f8a024a67cdd16e83e70ced879e5913a (patch)
tree61941fe2dd8a5916a270b6fe899c59e04ad55a9f /gitlab/cli.py
parentf4fcf4550eddf5c897e432efbc3ef605d6a8a419 (diff)
downloadgitlab-b05c0b67f8a024a67cdd16e83e70ced879e5913a.tar.gz
[CLI] Fix wrong use of arguments
The previous change removed undefined arguments from the args dict, don't try to use possibly missing arguments without a fallback value.
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r--gitlab/cli.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py
index 3a80bbc..32b3ec8 100644
--- a/gitlab/cli.py
+++ b/gitlab/cli.py
@@ -181,7 +181,7 @@ class GitlabCLI(object):
def do_project_all(self, cls, gl, what, args):
try:
- return gl.projects.all(all=args['all'])
+ return gl.projects.all(all=args.get('all', False))
except Exception as e:
_die("Impossible to list all projects", e)
@@ -333,10 +333,10 @@ class GitlabCLI(object):
def do_project_merge_request_merge(self, cls, gl, what, args):
try:
o = self.do_get(cls, gl, what, args)
- should_remove = args['should_remove_source_branch']
- build_succeeds = args['merged_when_build_succeeds']
+ should_remove = args.get('should_remove_source_branch', False)
+ build_succeeds = args.get('merged_when_build_succeeds', False)
return o.merge(
- merge_commit_message=args['merge_commit_message'],
+ merge_commit_message=args.get('merge_commit_message', ''),
should_remove_source_branch=should_remove,
merged_when_build_succeeds=build_succeeds)
except Exception as e: