def _get_tap_id_association(self, context, tap_service_id): try: query = model_query.query_with_hooks(context, TapIdAssociation) return query.filter( TapIdAssociation.tap_service_id == tap_service_id).one() except exc.NoResultFound: raise taas.TapServiceNotFound(tap_id=tap_service_id)
def delete_tap_service(self, context, id): LOG.debug("delete_tap_service() called") count = context.session.query(TapService).filter_by(id=id).delete() if not count: raise taas.TapServiceNotFound(tap_id=id)
def _get_tap_service(self, context, id): try: return model_query.get_by_id(context, TapService, id) except exc.NoResultFound: raise taas.TapServiceNotFound(tap_id=id)