def find_transport(tid=None):
        """
        find transport according to transport ID.
        :param tid: transport id
        :return: the transport if found or None if not found
        """
        LOGGER.debug("TransportService.find_transport")
        ret = None
        if tid is None or not tid:
            raise exceptions.ArianeCallParametersError('id')

        params = SessionService.complete_transactional_req({
            'ID': tid
        })

        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            params['OPERATION'] = 'getTransport'
            args = {'properties': params}
        else:
            args = {'http_operation': 'GET', 'operation_path': 'get', 'parameters': params}

        response = TransportService.requester.call(args)

        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            response = response.get()

        if response.rc == 0:
            ret = Transport.json_2_transport(response.response_content)
        elif response.rc != 404:
            err_msg = 'TransportService.find_transport - Problem while searching transport (id:' + str(tid) + '). ' + \
                      'Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) + \
                      " (" + str(response.rc) + ")"
            LOGGER.warning(err_msg)
            if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                raise ArianeMappingOverloadError("Transport.find_transport",
                                                 ArianeMappingOverloadError.ERROR_MSG)
            # traceback.print_stack()
        return ret
def find_transport ( tid = None ) : LOGGER . debug ( "TransportService.find_transport" ) ret = None if tid is None or not tid : raise exceptions . ArianeCallParametersError ( 'id' ) params = SessionService . complete_transactional_req ( { 'ID' : tid } ) if MappingService . driver_type != DriverFactory . DRIVER_REST : params [ 'OPERATION' ] = 'getTransport' args = { 'properties' : params } else : args = { 'http_operation' : 'GET' , 'operation_path' : 'get' , 'parameters' : params } response = TransportService . requester . call ( args ) if MappingService . driver_type != DriverFactory . DRIVER_REST : response = response . get ( ) if response . rc == 0 : ret = Transport . json_2_transport ( response . response_content ) elif response . rc != 404 : err_msg = 'TransportService.find_transport - Problem while searching transport (id:' + str ( tid ) + '). ' + 'Reason: ' + str ( response . response_content ) + ' - ' + str ( response . error_message ) + " (" + str ( response . rc ) + ")" LOGGER . warning ( err_msg ) if response . rc == 500 and ArianeMappingOverloadError . ERROR_MSG in response . error_message : raise ArianeMappingOverloadError ( "Transport.find_transport" , ArianeMappingOverloadError . ERROR_MSG ) return ret
find transport according to transport ID.
        :param tid: transport id
        :return: the transport if found or None if not found