From 40eff82ec311bfd1b6b763de871c09ca1d4ec4c2 Mon Sep 17 00:00:00 2001 From: Akhilesh Samineni <47657796+AkhileshSamineni@users.noreply.github.com> Date: Sat, 22 Feb 2020 00:56:25 +0530 Subject: [PATCH] Multi-Db changes for NAT feature. (#818) --- config/nat.py | 6 +++--- scripts/natclear | 2 +- scripts/natshow | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/nat.py b/config/nat.py index 1c30aa80d4..762252eea8 100644 --- a/config/nat.py +++ b/config/nat.py @@ -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 @@ -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 @@ -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 diff --git a/scripts/natclear b/scripts/natclear index 76cd394f50..be4b2060e3 100644 --- a/scripts/natclear +++ b/scripts/natclear @@ -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 diff --git a/scripts/natshow b/scripts/natshow index d0dc753702..3d810d6aae 100644 --- a/scripts/natshow +++ b/scripts/natshow @@ -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):