Skip to content

Commit 8b5625c

Browse files
committed
Including the fix from 1706 since the merge conflict is complicated
1 parent 0cb6219 commit 8b5625c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

systemvm/patches/debian/config/opt/cloud/bin/cs_forwardingrules.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def merge(dbag, rules):
6464
print "removing index %s" % str(index)
6565
if not index == -1:
6666
del dbag[source_ip][index]
67+
# If all forwarding rules have been deleted
68+
# remove IP from databag
69+
if dbag[source_ip] == []:
70+
del dbag[source_ip]
6771

6872
return dbag
6973

systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ def merge(dbag, ip):
4545
if ip['nw_type'] == 'control':
4646
dbag[ip['device']] = [ip]
4747
else:
48-
if index != -1:
49-
dbag[ip['device']][index] = ip
48+
if ip['add']:
49+
if index != -1:
50+
dbag[ip['device']][index] = ip
51+
else:
52+
dbag.setdefault(ip['device'], []).append(ip)
5053
else:
51-
dbag.setdefault(ip['device'], []).append(ip)
54+
if index != -1:
55+
del(dbag[ip['device']][index])
5256

5357
return dbag

0 commit comments

Comments
 (0)