diff --git a/acl_loader/main.py b/acl_loader/main.py index a0df16dc48e1..b8fededb6e0c 100644 --- a/acl_loader/main.py +++ b/acl_loader/main.py @@ -422,25 +422,34 @@ def show_table(self, table_name): :param table_name: Optional. ACL table name. Filter tables by specified name. :return: """ - header = ("Name", "Type", "Ports", "Description") + header = ("Name", "Type", "Binding", "Description") data = [] for key, val in self.get_tables_db_info().iteritems(): if table_name and key != table_name: continue - if not val["ports"]: - data.append([key, val["type"], "", val["policy_desc"]]) + if val["type"] == AclLoader.ACL_TABLE_TYPE_CTRLPLANE: + services = natsorted(val["services"]) + data.append([key, val["type"], services[0], val["policy_desc"]]) + + if len(services) > 1: + for service in services[1:]: + data.append(["", "", service, ""]) else: - ports = natsorted(val["ports"]) - data.append([key, val["type"], ports[0], val["policy_desc"]]) + if not val["ports"]: + data.append([key, val["type"], "", val["policy_desc"]]) + else: + ports = natsorted(val["ports"]) + data.append([key, val["type"], ports[0], val["policy_desc"]]) - if len(ports) > 1: - for port in ports[1:]: - data.append(["", "", port, ""]) + if len(ports) > 1: + for port in ports[1:]: + data.append(["", "", port, ""]) print(tabulate.tabulate(data, headers=header, tablefmt="simple", missingval="")) + def show_session(self, session_name): """ Show mirror session configuration.