Skip to content

Commit ffa66e9

Browse files
authored
Remove debug dump import by default (sonic-net#3715)
- What I did Remove debug dump import by default, Starting 202411, debug dump started to import libdashapi to parse DASH objects. Keeping this in default import path is causing CLI execution time to increase. - How I did it Make the import on-demand - How to verify it UT and verified on the image
1 parent fc3a3cb commit ffa66e9

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

utilities_common/helper.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from dump.match_infra import MatchEngine, MatchRequest, ConnectionPool
2-
from dump.match_helper import get_matched_keys
31
from .db import Db
42
import copy
53

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

23-
conn_pool = ConnectionPool()
21+
from dump import match_infra, match_helper
22+
conn_pool = match_infra.ConnectionPool()
2423
conn_pool.fill(ns, db_wrap.db_clients[ns], db_wrap.db_list)
25-
m_engine = MatchEngine(conn_pool)
26-
req = MatchRequest(db="CONFIG_DB",
27-
table=ACL,
28-
key_pattern="*",
29-
field="ports@",
30-
value=port,
31-
ns=ns,
32-
match_entire_list=False)
24+
m_engine = match_infra.MatchEngine(conn_pool)
25+
req = match_infra.MatchRequest(db="CONFIG_DB",
26+
table=ACL,
27+
key_pattern="*",
28+
field="ports@",
29+
value=port,
30+
ns=ns,
31+
match_entire_list=False)
3332
ret = m_engine.fetch(req)
34-
acl_tables, _ = get_matched_keys(ret)
33+
acl_tables, _ = match_helper.get_matched_keys(ret)
3534
return acl_tables
3635

3736

@@ -52,18 +51,19 @@ def get_port_pbh_binding(db_wrap, port, ns):
5251
if not isinstance(db_wrap, Db):
5352
raise Exception("db_wrap object is not of type utilities_common.Db")
5453

55-
conn_pool = ConnectionPool()
54+
from dump import match_infra, match_helper
55+
conn_pool = match_infra.ConnectionPool()
5656
conn_pool.fill(ns, db_wrap.db_clients[ns], db_wrap.db_list)
57-
m_engine = MatchEngine(conn_pool)
58-
req = MatchRequest(db="CONFIG_DB",
59-
table=PBH,
60-
key_pattern="*",
61-
field="interface_list@",
62-
value=port,
63-
ns=ns,
64-
match_entire_list=False)
57+
m_engine = match_infra.MatchEngine(conn_pool)
58+
req = match_infra.MatchRequest(db="CONFIG_DB",
59+
table=PBH,
60+
key_pattern="*",
61+
field="interface_list@",
62+
value=port,
63+
ns=ns,
64+
match_entire_list=False)
6565
ret = m_engine.fetch(req)
66-
pbh_tables, _ = get_matched_keys(ret)
66+
pbh_tables, _ = match_helper.get_matched_keys(ret)
6767
return pbh_tables
6868

6969

0 commit comments

Comments
 (0)