Skip to content

Commit

Permalink
Multi-Db changes for NAT feature. (sonic-net#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkhileshSamineni authored Feb 21, 2020
1 parent a4cb4dd commit 40eff82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions config/nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def add_basic(ctx, global_ip, local_ip, nat_type, twice_nat_id):
ctx.fail("Given entry is overlapping with existing Dynamic entry !!")

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

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

if entryFound is False:
counters_db = SonicV2Connector(host="127.0.0.1")
counters_db = SonicV2Connector()
counters_db.connect(counters_db.COUNTERS_DB)
snat_entries = 0
max_entries = 0
Expand Down
2 changes: 1 addition & 1 deletion scripts/natclear
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class NatClear(object):

def __init__(self):
super(NatClear,self).__init__()
self.db = SonicV2Connector(host="127.0.0.1")
self.db = SonicV2Connector()
self.db.connect(self.db.APPL_DB)
return

Expand Down
6 changes: 3 additions & 3 deletions scripts/natshow
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class NatShow(object):

def __init__(self):
super(NatShow,self).__init__()
self.asic_db = SonicV2Connector(host="127.0.0.1")
self.appl_db = SonicV2Connector(host="127.0.0.1")
self.counters_db = SonicV2Connector(host="127.0.0.1")
self.asic_db = SonicV2Connector()
self.appl_db = SonicV2Connector()
self.counters_db = SonicV2Connector()
return

def fetch_count(self):
Expand Down

0 comments on commit 40eff82

Please sign in to comment.