File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
systemvm/patches/debian/config/opt/cloud/bin Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments