From a9e37e53f28eef4566b0859842d58fec26e702a4 Mon Sep 17 00:00:00 2001 From: reedip Date: Thu, 3 Mar 2016 17:47:21 +0900 Subject: [PATCH] Avoid using _get_tenant_id_for_create It will be removed in N. TrivialFix Change-Id: I7b013550a8ee030209743c48e73441a0844aa766 --- neutron_taas/db/taas_db.py | 4 ++-- neutron_taas/services/taas/taas_plugin.py | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/neutron_taas/db/taas_db.py b/neutron_taas/db/taas_db.py index 73aabb4..f4b09ab 100755 --- a/neutron_taas/db/taas_db.py +++ b/neutron_taas/db/taas_db.py @@ -117,7 +117,7 @@ class Tass_db_Mixin(taas.TaasPluginBase, base_db.CommonDbMixin): def create_tap_service(self, context, tap_service): LOG.debug("create_tap_service() called") t_s = tap_service['tap_service'] - tenant_id = self._get_tenant_id_for_create(context, t_s) + tenant_id = t_s['tenant_id'] with context.session.begin(subtransactions=True): tap_service_db = TapService( id=uuidutils.generate_uuid(), @@ -141,7 +141,7 @@ class Tass_db_Mixin(taas.TaasPluginBase, base_db.CommonDbMixin): def create_tap_flow(self, context, tap_flow): LOG.debug("create_tap_flow() called") t_f = tap_flow['tap_flow'] - tenant_id = self._get_tenant_id_for_create(context, t_f) + tenant_id = t_f['tenant_id'] # TODO(Vinay): Check for the tenant_id validation # TODO(Vinay): Check for the source port validation with context.session.begin(subtransactions=True): diff --git a/neutron_taas/services/taas/taas_plugin.py b/neutron_taas/services/taas/taas_plugin.py index 8d250ff..d247886 100755 --- a/neutron_taas/services/taas/taas_plugin.py +++ b/neutron_taas/services/taas/taas_plugin.py @@ -110,10 +110,8 @@ class TaasPlugin(taas_db.Tass_db_Mixin): def create_tap_service(self, context, tap_service): LOG.debug("create_tap_service() called") - tenant_id = self._get_tenant_id_for_create(context, - tap_service['tap_service']) - t_s = tap_service['tap_service'] + tenant_id = t_s['tenant_id'] port_id = t_s['port_id'] # Get port details @@ -192,10 +190,8 @@ class TaasPlugin(taas_db.Tass_db_Mixin): def create_tap_flow(self, context, tap_flow): LOG.debug("create_tap_flow() called") - tenant_id = self._get_tenant_id_for_create(context, - tap_flow['tap_flow']) - t_f = tap_flow['tap_flow'] + tenant_id = t_f['tenant_id'] # Check if the tenant id of the source port is the same as the # tenant_id of the tap service we are attaching it to.