Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias alias alias alias alias Import alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword Call AttributeLoad NameLoad attr NameLoad decorator_list Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Str Assign NameStore Str Assign AttributeStore NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Str Assign NameStore Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str AttributeLoad NameLoad attr decorator_list Call NameLoad Str Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr ListLoad Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str ListLoad Str Expr Call AttributeLoad NameLoad attr Str Assert UnaryOpNot AttributeLoad NameLoad attr decorator_list Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str ListLoad Str Assign NameStore Str Assign AttributeStore AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str AttributeLoad NameLoad attr NameLoad decorator_list Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpAdd BinOpAdd Str NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str ListLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str ListLoad Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Assert AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad keyword ListLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd BinOpAdd Str AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str Call NameLoad Str decorator_list
N/A N/A 
Tests the presto diagnostic information using presto-admin collect
 os path mock patch fabric.api env N/A requests prestoadmin collect prestoadmin.collect TMP_PRESTO_DEBUG PRESTOADMIN_LOG_NAME PRESTOADMIN_LOG_DIR OUTPUT_FILENAME_FOR_LOGS OUTPUT_FILENAME_FOR_SYS_INFO N/A prestoadmin tests.unit.base_unit_case BaseUnitCase TestCollect N/A BaseUnitCase N/A test_collect_logs N/A N/A self path_exists_mock mkdirs_mock copy_mock tarfile_open_mock get_files_mock server_log_mock launcher_log_mock N/A N/A N/A downloaded_logs_loc N/A N/A path join TMP_PRESTO_DEBUG logs N/A N/A path_exists_mock return_value False N/A N/A N/A collect logs N/A N/A N/A mkdirs_mock assert_called_with downloaded_logs_loc N/A N/A N/A copy_mock assert_called_with N/A N/A path join PRESTOADMIN_LOG_DIR PRESTOADMIN_LOG_NAME downloaded_logs_loc N/A N/A N/A tarfile_open_mock assert_called_with OUTPUT_FILENAME_FOR_LOGS w:bz2 N/A tar N/A tarfile_open_mock return_value N/A N/A N/A N/A tar add assert_called_with downloaded_logs_loc arcname N/A N/A path basename downloaded_logs_loc N/A N/A patch prestoadmin.collect.lookup_launcher_log_file N/A patch prestoadmin.collect.lookup_server_log_file N/A patch prestoadmin.collect.get_files N/A patch prestoadmin.collect.tarfile.open N/A patch prestoadmin.collect.shutil.copy N/A patch prestoadmin.collect.ensure_directory_exists N/A patch prestoadmin.collect.os.path.exists test_get_files N/A N/A self get_mock path_exists_mock N/A N/A N/A remote_path /a/b N/A local_path /c/d N/A N/A env host myhost N/A path_with_host_name N/A N/A path join local_path N/A env host N/A N/A path_exists_mock return_value True N/A N/A N/A collect get_files remote_path local_path N/A N/A N/A get_mock assert_called_with remote_path path_with_host_name True N/A N/A patch prestoadmin.collect.os.path.exists N/A patch prestoadmin.collect.get test_get_files_warning N/A N/A self get_mock warn_mock path_exists_mock N/A N/A N/A remote_path /a/b N/A local_path /c/d N/A N/A env host remote_host N/A N/A path_exists_mock return_value True N/A N/A get_mock side_effect SystemExit N/A N/A N/A collect get_files remote_path local_path N/A N/A N/A warn_mock assert_called_with N/A N/A N/A remote path  remote_path  not found on  N/A env host N/A N/A patch prestoadmin.collect.os.path.exists N/A patch prestoadmin.collect.warn N/A patch prestoadmin.collect.get test_query_info_not_run_on_workers N/A N/A self req_get_mock N/A N/A N/A N/A env host N/A worker1 N/A N/A N/A env roledefs N/A worker N/A worker1 N/A N/A N/A collect query_info any_query_id N/A N/A N/A req_get_mock called N/A N/A patch prestoadmin.collect.requests.get test_query_info_fail_invalid_id N/A N/A self req_get_mock requests_url N/A N/A N/A N/A env host myhost N/A N/A N/A env roledefs N/A coordinator N/A myhost N/A query_id invalid_id N/A N/A N/A req_get_mock return_value status_code N/A N/A N/A requests codes ok 10 N/A N/A N/A self assertRaisesRegexp SystemExit Unable to retrieve information. Please check that the query_id is correct, or check that server is up with command: server status N/A collect query_info query_id N/A N/A patch prestoadmin.collect.request_url N/A patch prestoadmin.collect.requests.get test_collect_query_info N/A N/A self requests_url_mock requests_get_mock path_exist_mock mkdir_mock open_mock req_json_mock json_dumps_mock N/A N/A N/A query_id 1234_abcd N/A query_info_file_name N/A N/A path join TMP_PRESTO_DEBUG N/A N/A query_info_ query_id .json N/A N/A path_exist_mock return_value False N/A file_obj N/A N/A N/A open_mock return_value __enter__ return_value N/A N/A N/A N/A requests_get_mock return_value json return_value req_json_mock N/A N/A N/A requests_get_mock return_value status_code N/A N/A requests codes ok N/A N/A env host myhost N/A N/A N/A env roledefs N/A coordinator N/A myhost N/A N/A N/A collect query_info query_id N/A N/A N/A mkdir_mock assert_called_with TMP_PRESTO_DEBUG N/A N/A N/A open_mock assert_called_with query_info_file_name w N/A N/A N/A json_dumps_mock assert_called_with req_json_mock indent 4 N/A N/A N/A N/A file_obj write assert_called_with N/A json_dumps_mock return_value N/A N/A patch prestoadmin.collect.json.dumps N/A patch prestoadmin.collect.requests.models.json N/A patch __builtin__.open N/A patch prestoadmin.collect.os.mkdir N/A patch prestoadmin.collect.os.path.exists N/A patch prestoadmin.collect.requests.get N/A patch prestoadmin.collect.request_url test_collect_system_info N/A N/A self requests_url_mock requests_get_mock path_exists_mock mkdir_mock open_mock execute_mock req_json_mock json_dumps_mock conn_info_mock make_tarfile_mock N/A N/A N/A downloaded_sys_info_loc N/A N/A path join TMP_PRESTO_DEBUG sysinfo N/A node_info_file_name N/A N/A path join downloaded_sys_info_loc node_info.json N/A conn_info_file_name N/A N/A path join downloaded_sys_info_loc connector_info.txt N/A N/A path_exists_mock return_value False N/A file_obj N/A N/A N/A open_mock return_value __enter__ return_value N/A N/A N/A N/A requests_get_mock return_value json return_value req_json_mock N/A N/A N/A requests_get_mock return_value status_code N/A N/A requests codes ok N/A connector_info N/A conn_info_mock return_value N/A N/A env host myhost N/A N/A N/A env roledefs N/A coordinator N/A myhost N/A N/A N/A collect system_info N/A N/A N/A mkdir_mock assert_any_call TMP_PRESTO_DEBUG N/A N/A N/A mkdir_mock assert_called_with downloaded_sys_info_loc N/A N/A N/A open_mock assert_any_call node_info_file_name w N/A N/A N/A json_dumps_mock assert_called_with req_json_mock indent 4 N/A N/A N/A N/A file_obj write assert_any_call N/A json_dumps_mock return_value N/A N/A N/A open_mock assert_any_call conn_info_file_name w N/A N/A conn_info_mock called N/A N/A N/A N/A file_obj write assert_any_call N/A connector_info N/A N/A N/A execute_mock assert_called_with N/A collect get_system_info downloaded_sys_info_loc roles N/A N/A N/A N/A make_tarfile_mock assert_called_with OUTPUT_FILENAME_FOR_SYS_INFO downloaded_sys_info_loc N/A N/A patch prestoadmin.collect.make_tarfile N/A patch prestoadmin.collect.get_connector_info_from N/A patch prestoadmin.collect.json.dumps N/A patch prestoadmin.collect.requests.models.json N/A patch prestoadmin.collect.execute N/A patch __builtin__.open N/A patch prestoadmin.collect.os.mkdir N/A patch prestoadmin.collect.os.path.exists N/A patch prestoadmin.collect.requests.get N/A patch prestoadmin.collect.request_url test_get_system_info N/A N/A self exists_mock run_collect_mock plat_info_mock java_version_mock server_version_mock append_mock get_files_mock N/A N/A N/A downloaded_sys_info_loc N/A N/A path join TMP_PRESTO_DEBUG sysinfo N/A version_info_file_name N/A N/A path join TMP_PRESTO_DEBUG version_info.txt N/A platform_info platform abcd N/A server_version dummy_verion N/A java_version java dummy version N/A N/A exists_mock return_value False N/A N/A plat_info_mock return_value platform_info N/A N/A java_version_mock return_value java_version N/A N/A server_version_mock return_value server_version N/A N/A N/A collect get_system_info downloaded_sys_info_loc N/A N/A N/A exists_mock assert_any_call TMP_PRESTO_DEBUG N/A N/A N/A run_collect_mock assert_any_call N/A mkdir  TMP_PRESTO_DEBUG N/A N/A N/A exists_mock assert_any_call version_info_file_name N/A N/A N/A append_mock assert_any_call version_info_file_name N/A N/A platform information :  platform_info N/A N/A N/A append_mock assert_any_call version_info_file_name N/A N/A Java version:  java_version N/A N/A N/A append_mock assert_any_call version_info_file_name N/A N/A Presto-admin version:  N/A prestoadmin __version__ N/A N/A N/A append_mock assert_any_call version_info_file_name N/A N/A Presto server version:  server_version N/A N/A N/A get_files_mock assert_called_with version_info_file_name downloaded_sys_info_loc N/A N/A patch prestoadmin.collect.get_files N/A patch prestoadmin.collect.append N/A patch prestoadmin.collect.get_presto_version N/A patch prestoadmin.collect.get_java_version N/A patch prestoadmin.collect.get_platform_information N/A patch prestoadmin.collect.run N/A patch prestoadmin.collect.exists N/A