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 []
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
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