Fix displaying list columns with null values
The recent change to the client[1] broke displaying list columns that the Octavia API returns as null in the json. This occurs on listener create among other actions. This patch corrects the handling of lists that are returned as null instead of an empty list. Closes-Bug: #2112144 Change-Id: Ieb186837fd5b7a77aeba414ca38d9ab62a9a7518
This commit is contained in:
@@ -700,7 +700,9 @@ def get_availabilityzoneprofile_attrs(client_manager, parsed_args):
|
||||
|
||||
|
||||
def format_list(data):
|
||||
return '\n'.join(i['id'] for i in data)
|
||||
if data:
|
||||
return '\n'.join(i['id'] for i in data)
|
||||
return None
|
||||
|
||||
|
||||
class ListColumn(columns.FormattableColumn):
|
||||
@@ -709,7 +711,9 @@ class ListColumn(columns.FormattableColumn):
|
||||
|
||||
|
||||
def format_list_flat(data):
|
||||
return '\n'.join(i for i in data)
|
||||
if data:
|
||||
return '\n'.join(i for i in data)
|
||||
return None
|
||||
|
||||
|
||||
class FlatListColumn(columns.FormattableColumn):
|
||||
|
Reference in New Issue
Block a user