mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
14 lines
367 B
Python
14 lines
367 B
Python
from pprint import pprint
|
|
|
|
def merge(dbag, ip):
|
|
added = False
|
|
for mac in dbag:
|
|
if mac == "id":
|
|
continue
|
|
for address in dbag[mac]:
|
|
if address['public_ip'] == ip['public_ip']:
|
|
dbag[mac].remove(address)
|
|
if ip['add']:
|
|
dbag.setdefault('eth' + str(ip['nic_dev_id']), []).append( ip )
|
|
return dbag
|