def delete_router_precommit(self, context, router_id): context._plugin = self router = self.get_router(context, router_id) with apic_mapper.mapper_context(context) as ctx: arouter_id = router_id and self.name_mapper.router( ctx, router['id'], openstack_owner=router['id']) self.manager.delete_router(arouter_id)
def _map_names(self, context, tenant_id, router_id, net_id, subnet_id): context._plugin = self with apic_mapper.mapper_context(context) as ctx: atenant_id = tenant_id and self.name_mapper.tenant(ctx, tenant_id) arouter_id = router_id and self.name_mapper.router(ctx, router_id) anet_id = net_id and self.name_mapper.network(ctx, net_id) asubnet_id = subnet_id and self.name_mapper.subnet(ctx, subnet_id) return atenant_id, arouter_id, anet_id, asubnet_id
def update_router_postcommit(self, context, router): context._plugin = self with apic_mapper.mapper_context(context) as ctx: arouter_id = router['id'] and self.name_mapper.router(ctx, router['id']) with self.manager.apic.transaction() as trs: self.manager.create_router(arouter_id, transaction=trs) if router['admin_state_up']: self.manager.enable_router(arouter_id, transaction=trs) else: self.manager.disable_router(arouter_id, transaction=trs)
def _map_names(self, context, tenant_id, router, network, subnet): context._plugin = self with apic_mapper.mapper_context(context) as ctx: atenant_id = tenant_id and self.name_mapper.tenant(ctx, tenant_id) arouter_id = router and router['id'] and self.name_mapper.router( ctx, router['id'], openstack_owner=router['tenant_id']) anet_id = (network and network['id'] and self.name_mapper.endpoint_group(ctx, network['id'])) asubnet_id = subnet and subnet['id'] and self.name_mapper.subnet( ctx, subnet['id']) return atenant_id, arouter_id, anet_id, asubnet_id
def _map_names(self, context, tenant_id, router, network, subnet): context._plugin = self._plugin with apic_mapper.mapper_context(context) as ctx: atenant_id = tenant_id and self.name_mapper.tenant(ctx, tenant_id) arouter_id = router and router['id'] and self.name_mapper.router( ctx, router['id'], openstack_owner=router['tenant_id']) anet_id = (network and network['id'] and self.name_mapper.endpoint_group(ctx, network['id'])) asubnet_id = subnet and subnet['id'] and self.name_mapper.subnet( ctx, subnet['id']) return atenant_id, arouter_id, anet_id, asubnet_id
def update_router_postcommit(self, context, router): context._plugin = self with apic_mapper.mapper_context(context) as ctx: arouter_id = router["id"] and self.name_mapper.router( ctx, router["id"], openstack_owner=router["tenant_id"] ) tenant_id = self.aci_mech_driver._get_router_aci_tenant(router) with self.manager.apic.transaction() as trs: vrf = self.aci_mech_driver._get_tenant_vrf(router["tenant_id"]) self.manager.create_router(arouter_id, owner=vrf["aci_tenant"], transaction=trs, context=vrf["aci_name"]) if router["admin_state_up"]: self.manager.enable_router(arouter_id, owner=tenant_id, transaction=trs) else: self.manager.disable_router(arouter_id, owner=tenant_id, transaction=trs)
def update_router_postcommit(self, context, router): context._plugin = self with apic_mapper.mapper_context(context) as ctx: arouter_id = router['id'] and self.name_mapper.router( ctx, router['id'], openstack_owner=router['tenant_id']) tenant_id = self.aci_mech_driver._get_router_aci_tenant(router) with self.manager.apic.transaction() as trs: vrf = self.aci_mech_driver._get_tenant_vrf(router['tenant_id']) self.manager.create_router(arouter_id, owner=vrf['aci_tenant'], transaction=trs, context=vrf['aci_name']) if router['admin_state_up']: self.manager.enable_router(arouter_id, owner=tenant_id, transaction=trs) else: self.manager.disable_router(arouter_id, owner=tenant_id, transaction=trs)
def update_router_postcommit(self, context, router): context._plugin = self._plugin with apic_mapper.mapper_context(context) as ctx: arouter_id = router['id'] and self.name_mapper.router( ctx, router['id'], openstack_owner=router['tenant_id']) tenant_id = self.aci_mech_driver._get_router_aci_tenant(router) with self.manager.apic.transaction() as trs: vrf = self.aci_mech_driver._get_tenant_vrf(router['tenant_id']) # A Neutron router is rendered as a contract. This contract # Will exist in the COMMON tenant when single tenant mode is false, # in the sys_id tenant otherwise. self.manager.create_router(arouter_id, owner=tenant_id, transaction=trs, context=vrf['aci_name']) if router['admin_state_up']: self.manager.enable_router(arouter_id, owner=tenant_id, transaction=trs) else: self.manager.disable_router(arouter_id, owner=tenant_id, transaction=trs)
def update_router_postcommit(self, context, router): context._plugin = self with apic_mapper.mapper_context(context) as ctx: arouter_id = router['id'] and self.name_mapper.router( ctx, router['id'], openstack_owner=router['tenant_id']) tenant_id = self.aci_mech_driver._get_router_aci_tenant(router) with self.manager.apic.transaction() as trs: vrf = self.aci_mech_driver._get_tenant_vrf(router['tenant_id']) # A Neutron router is rendered as a contract. This contract # Will exist in the COMMON tenant when single tenant mode is false, # in the sys_id tenant otherwise. self.manager.create_router(arouter_id, owner=tenant_id, transaction=trs, context=vrf['aci_name']) if router['admin_state_up']: self.manager.enable_router(arouter_id, owner=tenant_id, transaction=trs) else: self.manager.disable_router(arouter_id, owner=tenant_id, transaction=trs)
def delete_router_precommit(self, context, router_id): context._plugin = self with apic_mapper.mapper_context(context) as ctx: arouter_id = router_id and self.name_mapper.router(ctx, router_id) self.manager.delete_router(arouter_id)