Skip to content

Commit f4fcf45

Browse files
author
Gauvain Pocentek
committed
[CLI] ignore empty arguments
Gitlab 8.15 doesn't appreciate arguments with None as value. This breaks the python-gitlab CLI. Fixes #199
1 parent 35c6bbb commit f4fcf45

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitlab/cli.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,12 @@ def main():
511511
what = arg.what
512512

513513
# Remove CLI behavior-related args
514-
for item in ("gitlab", "config_file", "verbose", "what", "action"):
514+
for item in ("gitlab", "config_file", "verbose", "what", "action",
515+
"version"):
515516
args.pop(item)
516517

518+
args = {k: v for k, v in args.items() if v is not None}
519+
517520
cls = None
518521
try:
519522
cls = gitlab.__dict__[_what_to_cls(what)]

0 commit comments

Comments
 (0)