From 99fc9b7bda33584e793130d94b34bfecf2b2d90f Mon Sep 17 00:00:00 2001 From: Dimitrios Markou Date: Wed, 17 Jan 2018 16:13:58 +0200 Subject: [PATCH] Show classifier's name In continuation of this patch [0] we are adding the functionality of showing the names of the existing classifiers when the classifier-list command is getting executed. [0]: https://review.openstack.org/#/c/532203/ Depends-On: Ia586061c578a99662d49ad284d1ff313c350e1f3 Change-Id: If6d76a66ab0d37662d1b28fe1786b6e0ffc8171d Signed-off-by: Dimitrios Markou --- tackerclient/tacker/v1_0/nfvo/vnffg.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tackerclient/tacker/v1_0/nfvo/vnffg.py b/tackerclient/tacker/v1_0/nfvo/vnffg.py index 46c4b369..6cb7224b 100644 --- a/tackerclient/tacker/v1_0/nfvo/vnffg.py +++ b/tackerclient/tacker/v1_0/nfvo/vnffg.py @@ -29,6 +29,18 @@ class ListFC(tackerV10.ListCommand): resource = _FC list_columns = ['id', 'status', 'nfp_id', 'chain_id'] + def extend_list(self, data, parsed_args): + """Update the list_columns list. + + This method update the list_columns list by adding the + 'name' column in case the retrieved FC list from the tacker + server side contains the names of the FCs. + """ + for item in data: + if 'name' in item: + self.list_columns.insert(1, 'name') + break + class ShowFC(tackerV10.ShowCommand): """Show information of a given FC."""