Skip to content

Commit 6b28768

Browse files
author
Praveen Chaudhary
authored
[configdb.py]: Allow deletion of entire table from mod_config API. (sonic-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 [email protected]
1 parent ae2e038 commit 6b28768

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/swsssdk/configdb.py

+3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ def mod_config(self, data):
294294
"""
295295
for table_name in data:
296296
table_data = data[table_name]
297+
if table_data == None:
298+
self.delete_table(table_name)
299+
continue
297300
for key in table_data:
298301
self.mod_entry(table_name, key, table_data[key])
299302

0 commit comments

Comments
 (0)