From 0aa09426eb2df8e1c98c76b0b18227696c10daf6 Mon Sep 17 00:00:00 2001 From: Benature Wong Date: Sun, 26 Jun 2022 23:57:15 +0800 Subject: [PATCH] fix issue of table's action without match key --- p4utils/utils/thrift_API.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/p4utils/utils/thrift_API.py b/p4utils/utils/thrift_API.py index a8dd97d..9601620 100755 --- a/p4utils/utils/thrift_API.py +++ b/p4utils/utils/thrift_API.py @@ -334,7 +334,12 @@ def get_json_key(key): table.key += [(field_name, match_type, bitwidth)] self.tables[j_table["name"]] = table - + + # table's action has no match key + if len(j_table["key"]) == 0: + if j_table["name"].startswith(j_pipeline["source_info"]["source_fragment"]+"."): + self.tables[j_table["name"]] = table + for j_meter in get_json_key("meter_arrays"): meter_array = MeterArray(j_meter["name"], j_meter["id"]) if "is_direct" in j_meter and j_meter["is_direct"]: