Fetch data from an URL and save it under the given target name.

def fetch(url, fullpath):
    '''
    Fetch data from an URL and save it under the given target name.
    '''
    logger.debug("Fetching %s from %s" % (fullpath, url))

    try:
        tmpfile, headers = urlretrieve(url)
        if os.path.exists(fullpath):
            os.remove(fullpath)
        shutil.move(tmpfile, fullpath)
    except Exception as e:
        logger.error("Error during fetching: " + str(e))
        raise