Merge "Fix can't delete tap service on agent site"

This commit is contained in:
Jenkins 2016-07-16 18:35:13 +00:00 committed by Gerrit Code Review
commit c612a729e7
2 changed files with 19 additions and 3 deletions

View File

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron.common import exceptions as n_exc
from neutron.common import rpc as n_rpc
from neutron_taas.common import topics
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
taas_vlan_id = (tap_id_association['taas_id'] +
cfg.CONF.taas.vlan_range_start)
port = self.service_plugin._get_port_details(context._plugin_context,
ts['port_id'])
host = port['binding:host_id']
try:
port = self.service_plugin._get_port_details(
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,
'taas_id': taas_vlan_id,

View File

@ -37,3 +37,12 @@ class TaaSExtensionTestJSON(base.BaseTaaSTest):
tap_service = self.create_tap_service(port_id=port['id'])
self.create_tap_flow(tap_service_id=tap_service['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'])