def delete_servicechain_spec(self, context, spec_id): policy_actions = self._grouppolicy_plugin.get_policy_actions( context, filters={"action_value": [spec_id]}) if policy_actions: raise schain.ServiceChainSpecInUse(spec_id=spec_id) with context.session.begin(subtransactions=True): spec_db = self._get_servicechain_spec(context, spec_id) if spec_db.instances: raise schain.ServiceChainSpecInUse(spec_id=spec_id) context.session.delete(spec_db)
def delete_servicechain_spec(self, context, spec_id): policy_actions = self._grouppolicy_plugin.get_policy_actions( context, filters={"action_value": [spec_id]}) if policy_actions: raise schain.ServiceChainSpecInUse(spec_id=spec_id) with db_api.CONTEXT_WRITER.using(context): spec_db = self._get_servicechain_spec(context, spec_id) if spec_db.instances: raise schain.ServiceChainSpecInUse(spec_id=spec_id) context.session.delete(spec_db)