Skip to content

Commit

Permalink
[configdb.py]: Allow deletion of entire table from mod_config API. (s…
Browse files Browse the repository at this point in the history
…onic-net#61)

sonic-cfggen uses mod_config to write to db. mod_config API should allow
deletion of entire table instead of throwing python exception.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
  • Loading branch information
Praveen Chaudhary authored Feb 12, 2020
1 parent ae2e038 commit 6b28768
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/swsssdk/configdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ def mod_config(self, data):
"""
for table_name in data:
table_data = data[table_name]
if table_data == None:
self.delete_table(table_name)
continue
for key in table_data:
self.mod_entry(table_name, key, table_data[key])

Expand Down

0 comments on commit 6b28768

Please sign in to comment.