summaryrefslogtreecommitdiff
path: root/gitlab/v4/cli.py
diff options
context:
space:
mode:
authorxarx00 <xarx@sms.cz>2019-03-04 15:15:51 +0100
committerMax Wittig <max.wittig95@gmail.com>2019-07-21 18:53:34 +0200
commit8d1552a0ad137ca5e14fabfc75f7ca034c2a78ca (patch)
treef0f3894ae8f72b157cc05708884de9ee1e846619 /gitlab/v4/cli.py
parent8306ef21be731336c9706c9908133cfcb3b6a5f4 (diff)
downloadgitlab-8d1552a0ad137ca5e14fabfc75f7ca034c2a78ca.tar.gz
fix(cli): don't fail when the short print attr value is None
Fixes #717 Fixes #727
Diffstat (limited to 'gitlab/v4/cli.py')
-rw-r--r--gitlab/v4/cli.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py
index f0ed199..6fc41ac 100644
--- a/gitlab/v4/cli.py
+++ b/gitlab/v4/cli.py
@@ -312,7 +312,7 @@ def extend_parser(parser):
object_group = subparsers.add_parser(arg_name)
object_subparsers = object_group.add_subparsers(
- title="action", dest="action", help="Action to execute."
+ title="action", dest="whaction", help="Action to execute."
)
_populate_sub_parser_by_class(cls, object_subparsers)
object_subparsers.required = True
@@ -406,7 +406,7 @@ class LegacyPrinter(object):
id = getattr(obj, obj._id_attr)
print("%s: %s" % (obj._id_attr.replace("_", "-"), id))
if hasattr(obj, "_short_print_attr"):
- value = getattr(obj, obj._short_print_attr)
+ value = getattr(obj, obj._short_print_attr) or "None"
value = value.replace("\r", "").replace("\n", " ")
# If the attribute is a note (ProjectCommitComment) then we do
# some modifications to fit everything on one line