Fix a bug that would add updated control ip address instead of replace

This commit is contained in:
Hugo Trippaers 2014-08-20 17:29:27 +02:00 committed by wilderrodrigues
parent 8f4461567d
commit a789e8bf57

View File

@ -16,5 +16,8 @@ def merge(dbag, ip):
ip['network'] = str(ipo.network) + '/' + str(ipo.prefixlen)
if 'nw_type' not in ip.keys():
ip['nw_type'] = 'public'
dbag.setdefault('eth' + str(ip['nic_dev_id']), []).append( ip )
if ip['nw_type'] == 'control':
dbag['eth' + str(ip['nic_dev_id'])] = [ ip ]
else:
dbag.setdefault('eth' + str(ip['nic_dev_id']), []).append( ip )
return dbag