Fix receiver list

Receiver list doesn't work for cluster_id of receiver
could be None now. This patch fixes it.

Change-Id: If0eb5af896d8482cb819597988b6ef0dc6e16e09
This commit is contained in:
yanyanhu
2016-09-05 23:50:43 -04:00
parent 26cc7dc595
commit 9c9e053f81
2 changed files with 2 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ class ListReceiver(command.Lister):
if not parsed_args.full_id:
formatters = {
'id': lambda x: x[:8],
'cluster_id': lambda x: x[:8],
'cluster_id': lambda x: x[:8] if x else None,
}
return (

View File

@@ -1335,7 +1335,7 @@ def do_receiver_list(service, args):
if not args.full_id:
formatters = {
'id': lambda x: x.id[:8],
'cluster_id': lambda x: x.cluster_id[:8],
'cluster_id': lambda x: x.cluster_id[:8] if x.cluster_id else '-',
}
utils.print_list(receivers, fields, formatters=formatters,
sortby_index=sortby_index)