Skip to content

Commit 182301a

Browse files
author
zhangjunhui
committed
Fix a bug in print_list when using formatters
If using formatters it will raise a error that local variable 'data' referenced before assignment story: 2008472 task: 41511 Change-Id: I6c66139b54a203bd8af01e8534e4d7ce7735e02d
1 parent 7c89521 commit 182301a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

troveclient/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def print_list(objs, fields, formatters={}, order_by=None, obj_is_dict=False,
173173
row = []
174174
for field in fields:
175175
if formatters and field in formatters:
176-
row.append(formatters[field](obj))
176+
data = formatters[field](obj)
177177
elif obj_is_dict:
178178
data = obj.get(field, '')
179179
else:

0 commit comments

Comments
 (0)