Merge pull request #29 from markmcclain/havana
fix error that can occur with adding subnet
This commit is contained in:
commit
9cc6d80a31
akanda/neutron/plugins
@ -79,7 +79,8 @@ def auto_add_subnet_to_router(f):
|
|||||||
return subnet
|
return subnet
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
# NOTE(mark): in Havana gateway_ip cannot be updated leaving here if this
|
||||||
|
# returns in Icehouse.
|
||||||
def sync_subnet_gateway_port(f):
|
def sync_subnet_gateway_port(f):
|
||||||
@functools.wraps(f)
|
@functools.wraps(f)
|
||||||
def wrapper(self, context, id, subnet):
|
def wrapper(self, context, id, subnet):
|
||||||
@ -211,6 +212,8 @@ def _update_internal_gateway_port_ip(context, router_id, subnet):
|
|||||||
for ip in routerport.port["fixed_ips"]
|
for ip in routerport.port["fixed_ips"]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
plugin = manager.NeutronManager.get_plugin()
|
||||||
|
|
||||||
for index, ip in enumerate(fixed_ips):
|
for index, ip in enumerate(fixed_ips):
|
||||||
if ip['subnet_id'] == subnet['id']:
|
if ip['subnet_id'] == subnet['id']:
|
||||||
if not subnet['gateway_ip']:
|
if not subnet['gateway_ip']:
|
||||||
@ -242,7 +245,6 @@ def _update_internal_gateway_port_ip(context, router_id, subnet):
|
|||||||
|
|
||||||
# we call into the plugin vs updating the db directly because of l3 hooks
|
# we call into the plugin vs updating the db directly because of l3 hooks
|
||||||
# baked into the plugins.
|
# baked into the plugins.
|
||||||
plugin = manager.NeutronManager.get_plugin()
|
|
||||||
port_dict = {'fixed_ips': fixed_ips}
|
port_dict = {'fixed_ips': fixed_ips}
|
||||||
plugin.update_port(
|
plugin.update_port(
|
||||||
context.elevated(),
|
context.elevated(),
|
||||||
|
@ -128,10 +128,6 @@ class NvpPluginV2(nvp.NvpPluginV2):
|
|||||||
def create_subnet(self, context, subnet):
|
def create_subnet(self, context, subnet):
|
||||||
return super(NvpPluginV2, self).create_subnet(context, subnet)
|
return super(NvpPluginV2, self).create_subnet(context, subnet)
|
||||||
|
|
||||||
@akanda.sync_subnet_gateway_port
|
|
||||||
def update_subnet(self, context, id, subnet):
|
|
||||||
return super(NvpPluginV2, self).update_subnet(context, id, subnet)
|
|
||||||
|
|
||||||
# we need to use original versions l3_db.L3_NAT_db_mixin mixin and not
|
# we need to use original versions l3_db.L3_NAT_db_mixin mixin and not
|
||||||
# NVP versions that manage NVP's logical router
|
# NVP versions that manage NVP's logical router
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user