Skip to content

Commit 40eff82

Browse files
Multi-Db changes for NAT feature. (sonic-net#818)
1 parent a4cb4dd commit 40eff82

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

config/nat.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def add_basic(ctx, global_ip, local_ip, nat_type, twice_nat_id):
283283
ctx.fail("Given entry is overlapping with existing Dynamic entry !!")
284284

285285
if entryFound is False:
286-
counters_db = SonicV2Connector(host="127.0.0.1")
286+
counters_db = SonicV2Connector()
287287
counters_db.connect(counters_db.COUNTERS_DB)
288288
snat_entries = 0
289289
max_entries = 0
@@ -363,7 +363,7 @@ def add_tcp(ctx, global_ip, global_port, local_ip, local_port, nat_type, twice_n
363363
ctx.fail("Given entry is overlapping with existing NAT entry !!")
364364

365365
if entryFound is False:
366-
counters_db = SonicV2Connector(host="127.0.0.1")
366+
counters_db = SonicV2Connector()
367367
counters_db.connect(counters_db.COUNTERS_DB)
368368
snat_entries = 0
369369
max_entries = 0
@@ -443,7 +443,7 @@ def add_udp(ctx, global_ip, global_port, local_ip, local_port, nat_type, twice_n
443443
ctx.fail("Given entry is overlapping with existing NAT entry !!")
444444

445445
if entryFound is False:
446-
counters_db = SonicV2Connector(host="127.0.0.1")
446+
counters_db = SonicV2Connector()
447447
counters_db.connect(counters_db.COUNTERS_DB)
448448
snat_entries = 0
449449
max_entries = 0

scripts/natclear

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NatClear(object):
2222

2323
def __init__(self):
2424
super(NatClear,self).__init__()
25-
self.db = SonicV2Connector(host="127.0.0.1")
25+
self.db = SonicV2Connector()
2626
self.db.connect(self.db.APPL_DB)
2727
return
2828

scripts/natshow

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ class NatShow(object):
6969

7070
def __init__(self):
7171
super(NatShow,self).__init__()
72-
self.asic_db = SonicV2Connector(host="127.0.0.1")
73-
self.appl_db = SonicV2Connector(host="127.0.0.1")
74-
self.counters_db = SonicV2Connector(host="127.0.0.1")
72+
self.asic_db = SonicV2Connector()
73+
self.appl_db = SonicV2Connector()
74+
self.counters_db = SonicV2Connector()
7575
return
7676

7777
def fetch_count(self):

0 commit comments

Comments
 (0)