harvester/ext/importer/ckan.py
def _get_input_storage():
    """
    Get the input storage from job dependencies.
    """

    # Get a list of dependencies of this job
    # We expect to get exactly *one*

    from jobcontrol.globals import current_app, execution_context

    deps = current_app.storage.get_job_deps(execution_context.job_id)

    if len(deps) != 1:
        raise RuntimeError("This job requires exactly *one* dependency, "
                           "which returned the URL to storage containing "
                           "the crawled data.")

    logger.debug('Job {0} dependencies: {1!r}'
                 .format(execution_context.job_id,
                         [x['id'] for x in deps]))

    # Get the output storage URL from the latest successful
    # build. Again, we need at least one successful build.

    dep_build = current_app.storage.get_latest_successful_build(deps[0]['id'])

    if dep_build is None:
        raise RuntimeError("Expected at least a successful build")

    return dep_build['retval']

    Get the input storage from job dependencies.
    
Get the input storage from job dependencies.
Get the input storage from job dependencies .
def _get_input_storage():
    from jobcontrol.globals import current_app, execution_context
    deps = current_app.storage.get_job_deps(execution_context.job_id)
    if len(deps) != 1:
        raise RuntimeError("This job requires exactly *one* dependency, "
                           "which returned the URL to storage containing "
                           "the crawled data.")
    logger.debug('Job {0} dependencies: {1!r}'
                 .format(execution_context.job_id,
                         [x['id'] for x in deps]))
    dep_build = current_app.storage.get_latest_successful_build(deps[0]['id'])
    if dep_build is None:
        raise RuntimeError("Expected at least a successful build")
    return dep_build['retval']
def _get_input_storage ( ) : from jobcontrol . globals import current_app , execution_context deps = current_app . storage . get_job_deps ( execution_context . job_id ) if len ( deps ) != 1 : raise RuntimeError ( "This job requires exactly *one* dependency, " "which returned the URL to storage containing " "the crawled data." ) logger . debug ( 'Job {0} dependencies: {1!r}' . format ( execution_context . job_id , [ x [ 'id' ] for x in deps ] ) ) dep_build = current_app . storage . get_latest_successful_build ( deps [ 0 ] [ 'id' ] ) if dep_build is None : raise RuntimeError ( "Expected at least a successful build" ) return dep_build [ 'retval' ]
Get the input storage from job dependencies.
Get the input storage from job dependencies .
"""
    Get the input storage from job dependencies.
    """ # Get a list of dependencies of this job # We expect to get exactly *one* # Get the output storage URL from the latest successful # build. Again, we need at least one successful build.