Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Db changes for NAT feature. #818

Merged
merged 1 commit into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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