CLOUDSTACK-9811: fixed an issue if the dev is not in the databag

This commit is contained in:
Will Stevens 2017-03-13 15:37:54 -04:00
parent 850c07cc8a
commit 8d4855b4eb

View File

@ -45,7 +45,7 @@ def merge(dbag, ip):
if ip['nw_type'] == 'control':
dbag[ip['device']] = [ip]
else:
if index != -1:
if index != -1 and ip['device'] in dbag and index in dbag[ip['device']]:
dbag[ip['device']][index] = ip
else:
dbag.setdefault(ip['device'], []).append(ip)