Skip to content

Commit

Permalink
Remove debug dump import by default
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekrnv authored Jan 13, 2025
1 parent 349a101 commit cde4911
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions utilities_common/helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from dump.match_infra import MatchEngine, MatchRequest, ConnectionPool
from dump.match_helper import get_matched_keys
from .db import Db
import copy

Expand All @@ -20,18 +18,19 @@ def get_port_acl_binding(db_wrap, port, ns):
if not isinstance(db_wrap, Db):
raise Exception("db_wrap object is not of type utilities_common.Db")

conn_pool = ConnectionPool()
from dump import match_infra, match_helper
conn_pool = match_infra.ConnectionPool()
conn_pool.fill(ns, db_wrap.db_clients[ns], db_wrap.db_list)
m_engine = MatchEngine(conn_pool)
req = MatchRequest(db="CONFIG_DB",
table=ACL,
key_pattern="*",
field="ports@",
value=port,
ns=ns,
match_entire_list=False)
m_engine = match_infra.MatchEngine(conn_pool)
req = match_infra.MatchRequest(db="CONFIG_DB",
table=ACL,
key_pattern="*",
field="ports@",
value=port,
ns=ns,
match_entire_list=False)
ret = m_engine.fetch(req)
acl_tables, _ = get_matched_keys(ret)
acl_tables, _ = match_helper.get_matched_keys(ret)
return acl_tables


Expand All @@ -51,19 +50,20 @@ def get_port_pbh_binding(db_wrap, port, ns):
PBH = "PBH_TABLE" # Table to look for port bindings
if not isinstance(db_wrap, Db):
raise Exception("db_wrap object is not of type utilities_common.Db")

conn_pool = ConnectionPool()

from dump import match_infra, match_helper
conn_pool = match_infra.ConnectionPool()
conn_pool.fill(ns, db_wrap.db_clients[ns], db_wrap.db_list)
m_engine = MatchEngine(conn_pool)
req = MatchRequest(db="CONFIG_DB",
table=PBH,
key_pattern="*",
field="interface_list@",
value=port,
ns=ns,
match_entire_list=False)
m_engine = match_infra.MatchEngine(conn_pool)
req = match_infra.MatchRequest(db="CONFIG_DB",
table=PBH,
key_pattern="*",
field="interface_list@",
value=port,
ns=ns,
match_entire_list=False)
ret = m_engine.fetch(req)
pbh_tables, _ = get_matched_keys(ret)
pbh_tables, _ = match_helper.get_matched_keys(ret)
return pbh_tables


Expand Down

0 comments on commit cde4911

Please sign in to comment.