Skip to content

Commit cb85389

Browse files
authored
Adapt to py-swsssdk refactor of mod_entry and mod_config (sonic-net#165)
1 parent 1c680b4 commit cb85389

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

acl_loader/main.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ def full_update(self):
340340
:return:
341341
"""
342342
for key in self.rules_db_info.keys():
343-
self.configdb.set_entry(self.ACL_RULE, key, None)
343+
self.configdb.mod_entry(self.ACL_RULE, key, None)
344344

345-
self.configdb.set_config({self.ACL_RULE: self.rules_info})
345+
self.configdb.mod_config({self.ACL_RULE: self.rules_info})
346346

347347
def incremental_update(self):
348348
"""
@@ -359,15 +359,15 @@ def incremental_update(self):
359359
existing_rules = new_rules.intersection(current_rules)
360360

361361
for key in removed_rules:
362-
self.configdb.set_entry(self.ACL_RULE, key, None)
362+
self.configdb.mod_entry(self.ACL_RULE, key, None)
363363

364364
for key in added_rules:
365-
self.configdb.set_entry(self.ACL_RULE, key, self.rules_info[key])
365+
self.configdb.mod_entry(self.ACL_RULE, key, self.rules_info[key])
366366

367367
for key in existing_rules:
368368
if cmp(self.rules_info[key], self.rules_db_info[key]):
369-
self.configdb.set_entry(self.ACL_RULE, key, None)
370-
self.configdb.set_entry(self.ACL_RULE, key, self.rules_info[key])
369+
self.configdb.mod_entry(self.ACL_RULE, key, None)
370+
self.configdb.mod_entry(self.ACL_RULE, key, self.rules_info[key])
371371

372372
def show_table(self, table_name):
373373
"""

config/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _switch_bgp_session_status_by_addr(ipaddress, status, verbose):
6565
click.echo("{} {} BGP session with neighbor {}...".format(verb, status, ipaddress))
6666
config_db = ConfigDBConnector()
6767
config_db.connect()
68-
config_db.set_entry('bgp_neighbor', ipaddress, {'admin_status': status})
68+
config_db.mod_entry('bgp_neighbor', ipaddress, {'admin_status': status})
6969

7070
def _switch_bgp_session_status(ipaddr_or_hostname, status, verbose):
7171
"""Start up or shut down BGP session by IP address or hostname

pfcwd/main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def start(action, restoration_time, ports, detection_time):
127127
for port in ports:
128128
if port not in all_ports:
129129
continue
130-
configdb.set_entry("PFC_WD_TABLE", port, None)
131-
configdb.set_entry("PFC_WD_TABLE", port, pfcwd_info)
130+
configdb.mod_entry("PFC_WD_TABLE", port, None)
131+
configdb.mod_entry("PFC_WD_TABLE", port, pfcwd_info)
132132

133133
# Stop WD
134134
@cli.command()
@@ -148,7 +148,7 @@ def stop(ports):
148148
for port in ports:
149149
if port not in all_ports:
150150
continue
151-
configdb.set_entry("PFC_WD_TABLE", port, None)
151+
configdb.mod_entry("PFC_WD_TABLE", port, None)
152152

153153
if __name__ == '__main__':
154154
cli()

0 commit comments

Comments
 (0)