Esempio n. 1
0
def gather_connectors(local_config_dir, allow_overwrite=False):
    local_catalog_dir = os.path.join(local_config_dir, env.host, 'catalog')
    if not allow_overwrite and os.path.exists(local_catalog_dir):
        fabric.utils.error("Refusing to overwrite %s" % local_catalog_dir)
    ensure_directory_exists(local_catalog_dir)
    if files.exists(constants.REMOTE_CATALOG_DIR):
        return get(constants.REMOTE_CATALOG_DIR, local_catalog_dir)
    else:
        return []
Esempio n. 2
0
def gather_connectors(local_config_dir, allow_overwrite=False):
    local_catalog_dir = os.path.join(local_config_dir, env.host, 'catalog')
    if not allow_overwrite and os.path.exists(local_catalog_dir):
        fabric.utils.error("Refusing to overwrite %s" % local_catalog_dir)
    ensure_directory_exists(local_catalog_dir)
    if files.exists(constants.REMOTE_CATALOG_DIR):
        return get(constants.REMOTE_CATALOG_DIR, local_catalog_dir)
    else:
        return []
Esempio n. 3
0
def logs():
    """
    Gather all the server logs and presto-admin log and create a tar file.
    """
    downloaded_logs_location = os.path.join(TMP_PRESTO_DEBUG, "logs")
    ensure_directory_exists(downloaded_logs_location)

    print 'Downloading logs from all the nodes...'
    execute(get_remote_log_files, downloaded_logs_location, roles=env.roles)

    copy_admin_log(downloaded_logs_location)

    make_tarfile(OUTPUT_FILENAME_FOR_LOGS, downloaded_logs_location)
    print 'logs archive created: ' + OUTPUT_FILENAME_FOR_LOGS
Esempio n. 4
0
def logs():
    """
    Gather all the server logs and presto-admin log and create a tar file.
    """
    downloaded_logs_location = os.path.join(TMP_PRESTO_DEBUG, "logs")
    ensure_directory_exists(downloaded_logs_location)

    print 'Downloading logs from all the nodes...'
    execute(get_remote_log_files, downloaded_logs_location, roles=env.roles)

    copy_admin_log(downloaded_logs_location)

    make_tarfile(OUTPUT_FILENAME_FOR_LOGS, downloaded_logs_location)
    print 'logs archive created: ' + OUTPUT_FILENAME_FOR_LOGS
Esempio n. 5
0
def logs(dest_dir=TMP_PRESTO_DEBUG):
    """
    Gather all the server logs and presto-admin log and create a tar file.

    Parameters:
        dest_dir - logs destination dir.  default /tmp/presto-debug
    """
    downloaded_logs_location = os.path.join(dest_dir, "logs")
    ensure_directory_exists(downloaded_logs_location)

    print 'Downloading logs from all the nodes...'
    execute(get_remote_log_files, downloaded_logs_location, roles=env.roles)

    copy_admin_log(downloaded_logs_location)
    logs_tar_file_location = os.path.join(dest_dir, OUTPUT_FILENAME_FOR_LOGS)
    make_tarfile(logs_tar_file_location, downloaded_logs_location)
    print 'logs archive created: ' + logs_tar_file_location