l3_extra_gws: Fix KeyError when removing extra GW port
If the port being removed is not the first one, the current code will raise a KeyError. Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com> Change-Id: I948ff385e8a6aa7ecccce26b04a9d67affaede2c
This commit is contained in:
parent
6d4c433cfc
commit
2ae623b2b4
|
@ -349,7 +349,7 @@ class ExtraGatewaysDbOnlyMixin(l3_gwmode_db.L3_NAT_dbonly_mixin):
|
|||
|
||||
# If the compatibility gw_port_id is to be removed, do it after
|
||||
# the removal of extra gateway ports but stash up some information.
|
||||
compat_gw_port_info = part_matches.pop(router_db['gw_port_id'])
|
||||
compat_gw_port_info = part_matches.pop(router_db['gw_port_id'], None)
|
||||
|
||||
# Actually remove extra gateways first.
|
||||
for extra_gw_port_id in part_matches.keys():
|
||||
|
|
Loading…
Reference in New Issue