Ian Southam 7fc3365459 Implemented delete (add : false) for cs_dhcp
Added some tests to the test_update_config tests for dhcp entries
2015-03-16 11:35:24 +01:00

16 lines
415 B
Python

from pprint import pprint
from netaddr import *
def merge(dbag, data):
# A duplicate ip address wil clobber the old value
# This seems desirable ....
if "add" in data and data['add'] == False and \
"ipv4_adress" in data :
if data['ipv4_adress'] in dbag:
del(dbag[data['ipv4_adress']])
return dbag
else:
dbag[data['ipv4_adress']] = data
return dbag