Merge "Fix can't delete tap service on agent site"
This commit is contained in:
commit
c612a729e7
@ -14,6 +14,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from neutron.common import exceptions as n_exc
|
||||||
from neutron.common import rpc as n_rpc
|
from neutron.common import rpc as n_rpc
|
||||||
from neutron_taas.common import topics
|
from neutron_taas.common import topics
|
||||||
from neutron_taas.extensions import taas as taas_ex
|
from neutron_taas.extensions import taas as taas_ex
|
||||||
@ -100,9 +101,15 @@ class TaasRpcDriver(service_drivers.TaasBaseDriver):
|
|||||||
tap_id_association = context.tap_id_association
|
tap_id_association = context.tap_id_association
|
||||||
taas_vlan_id = (tap_id_association['taas_id'] +
|
taas_vlan_id = (tap_id_association['taas_id'] +
|
||||||
cfg.CONF.taas.vlan_range_start)
|
cfg.CONF.taas.vlan_range_start)
|
||||||
port = self.service_plugin._get_port_details(context._plugin_context,
|
try:
|
||||||
ts['port_id'])
|
port = self.service_plugin._get_port_details(
|
||||||
host = port['binding:host_id']
|
context._plugin_context,
|
||||||
|
ts['port_id'])
|
||||||
|
host = port['binding:host_id']
|
||||||
|
except n_exc.PortNotFound:
|
||||||
|
# if not found, we just pass to None
|
||||||
|
port = None
|
||||||
|
host = None
|
||||||
|
|
||||||
rpc_msg = {'tap_service': ts,
|
rpc_msg = {'tap_service': ts,
|
||||||
'taas_id': taas_vlan_id,
|
'taas_id': taas_vlan_id,
|
||||||
|
@ -37,3 +37,12 @@ class TaaSExtensionTestJSON(base.BaseTaaSTest):
|
|||||||
tap_service = self.create_tap_service(port_id=port['id'])
|
tap_service = self.create_tap_service(port_id=port['id'])
|
||||||
self.create_tap_flow(tap_service_id=tap_service['id'],
|
self.create_tap_flow(tap_service_id=tap_service['id'],
|
||||||
direction='BOTH', source_port=port['id'])
|
direction='BOTH', source_port=port['id'])
|
||||||
|
|
||||||
|
@test.idempotent_id('d7a2115d-16b4-41cf-95a6-dcebc3682b24')
|
||||||
|
def test_delete_tap_service_after_delete_port(self):
|
||||||
|
network = self.create_network()
|
||||||
|
port = self.create_port(network)
|
||||||
|
tap_service = self.create_tap_service(port_id=port['id'])
|
||||||
|
# delete port
|
||||||
|
self.ports_client.delete_port(port['id'])
|
||||||
|
self.tap_services_client.delete_tap_service(tap_service['id'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user