Merge pull request #30 from rodis/bug/dhc-1560-fix-subnet-ownership
Fix autocreate subnet ownership problem
This commit is contained in:
commit
ec0e5767d4
@ -79,6 +79,7 @@ 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
|
# NOTE(mark): in Havana gateway_ip cannot be updated leaving here if this
|
||||||
# returns in Icehouse.
|
# returns in Icehouse.
|
||||||
def sync_subnet_gateway_port(f):
|
def sync_subnet_gateway_port(f):
|
||||||
@ -168,9 +169,11 @@ def _add_subnet_to_router(context, subnet):
|
|||||||
router = router_q.first()
|
router = router_q.first()
|
||||||
|
|
||||||
if not router:
|
if not router:
|
||||||
router_args = {'tenant_id': context.tenant_id,
|
router_args = {
|
||||||
'name': 'ak-%s' % context.tenant_id,
|
'tenant_id': subnet['tenant_id'],
|
||||||
'admin_state_up': True}
|
'name': 'ak-%s' % subnet['tenant_id'],
|
||||||
|
'admin_state_up': True
|
||||||
|
}
|
||||||
router = plugin.create_router(context, {'router': router_args})
|
router = plugin.create_router(context, {'router': router_args})
|
||||||
if not _update_internal_gateway_port_ip(context, router['id'], subnet):
|
if not _update_internal_gateway_port_ip(context, router['id'], subnet):
|
||||||
plugin.add_router_interface(context.elevated(),
|
plugin.add_router_interface(context.elevated(),
|
||||||
@ -279,6 +282,7 @@ def _add_ipv6_subnet(context, network):
|
|||||||
|
|
||||||
if not existing:
|
if not existing:
|
||||||
create_args = {
|
create_args = {
|
||||||
|
'tenant_id': network['tenant_id'],
|
||||||
'network_id': network['id'],
|
'network_id': network['id'],
|
||||||
'name': '',
|
'name': '',
|
||||||
'cidr': str(candidate_cidr),
|
'cidr': str(candidate_cidr),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user