Don't call PrettyTable add_row with a tuple.

Updates the print_dict function in utils.py so that it doesn't
try to append a tuple with add_row. According to pydoc add_row
should get passed a list (not a tuple):

  Arguments:

    row - row of data, should be a list with as many elements as
    the table has fields

This fixes a TypeError which can occur with the existing code:

TypeError: can only concatenate list (not "tuple") to list

Fixes LP Bug #1019409.

Change-Id: I16f745afa872106c3bc44c33d88db2a5aacd776c
This commit is contained in:
Dan Prince
2012-06-29 16:27:25 -04:00
parent ea3f85f026
commit 11258a06c2

View File

@@ -45,7 +45,7 @@ def print_dict(d):
for (prop, value) in d.iteritems(): for (prop, value) in d.iteritems():
if value is None: if value is None:
value = '' value = ''
pt.add_row((prop, value)) pt.add_row([prop, value])
print pt.get_string(sortby='Property') print pt.get_string(sortby='Property')