Skip to content

Commit

Permalink
Calling tuskar role-list would output blank lines
Browse files Browse the repository at this point in the history
The role description will sometimes include newlines. If the last
character is a newline this ends up looking like an empty line in
the shell output. Adding a filter for descriptions fixes this.

Change-Id: Ia8586ce3743481fa9618e17340996ace22f80915
Closes-Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1196203
  • Loading branch information
Lennart Regebro committed Jun 9, 2015
1 parent 47fdee0 commit 09d73e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tuskarclient/osc/v2/role.py
Expand Up @@ -33,6 +33,6 @@ def take_action(self, parsed_args):

return (
('uuid', 'name', 'version', 'description'),
((r.uuid, r.name, r.version, r.description)
((r.uuid, r.name, r.version, r.description.strip())
for r in roles)
)
3 changes: 3 additions & 0 deletions tuskarclient/v2/roles_shell.py
Expand Up @@ -14,6 +14,8 @@

import sys

import six

import tuskarclient.common.formatting as fmt


Expand All @@ -23,6 +25,7 @@ def do_role_list(tuskar, args, outfile=sys.stdout):
fields = ['uuid', 'name', 'version', 'description']

formatters = {
'description': six.text_type.strip,
}

fmt.print_list(roles, fields, formatters, outfile=outfile)

0 comments on commit 09d73e0

Please sign in to comment.