Avoid using _get_tenant_id_for_create

It will be removed in N.

TrivialFix

Change-Id: I7b013550a8ee030209743c48e73441a0844aa766
This commit is contained in:
reedip 2016-03-03 17:47:21 +09:00
parent b1a7accda0
commit a9e37e53f2
2 changed files with 4 additions and 8 deletions

View File

@ -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):

View File

@ -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.