Get better format for long lines with PrettyTable
Based on current implement, the cli output format will be bad if the lines are too long. This issue can be fixed by setting 'max_width'. However, there is a bug against it, see https://code.google.com/p/prettytable/source/browse/trunk/CHANGELOG?r=85 line 3. So the requirements.txt is updated as well. docImpact Fixes bug 1251283 Change-Id: I0d4192ad9d10a3d6d47a8319463a5edb57719a68
This commit is contained in:
@@ -118,12 +118,14 @@ def do_image_list(gc, args):
|
||||
|
||||
|
||||
@utils.arg('id', metavar='<IMAGE_ID>', help='ID of image to describe.')
|
||||
@utils.arg('--max-column-width', metavar='<integer>', default=80,
|
||||
help='The max column width of the printed table.')
|
||||
def do_image_show(gc, args):
|
||||
"""Describe a specific image."""
|
||||
image = gc.images.get(args.id)
|
||||
ignore = ['self', 'access', 'file', 'schema']
|
||||
image = dict([item for item in image.iteritems() if item[0] not in ignore])
|
||||
utils.print_dict(image)
|
||||
utils.print_dict(image, max_column_width=int(args.max_column_width))
|
||||
|
||||
|
||||
@utils.arg('--image-id', metavar='<IMAGE_ID>', required=True,
|
||||
|
||||
Reference in New Issue
Block a user