Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def merge(dbag, rules):
print "removing index %s" % str(index)
if not index == -1:
del dbag[source_ip][index]
# If all forwarding rules have been deleted
# remove IP from databag
if dbag[source_ip] == []:
del dbag[source_ip]

return dbag

Expand Down
3 changes: 2 additions & 1 deletion systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def merge(dbag, ip):
ip['nw_type'] = 'public'
if ip['nw_type'] == 'control':
dbag['eth' + str(ip['nic_dev_id'])] = [ip]
else:
# if ip['add'] is false, the IP will be removed from the databag
elif ip['add']:
dbag.setdefault('eth' + str(ip['nic_dev_id']), []).append(ip)

return dbag