{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/teuthology/pulls/comments/24864746","id":24864746,"diff_hunk":"@@ -359,6 +359,43 @@ def check_conflict(ctx, config):\n     if failed:\n         raise RuntimeError('Stale jobs detected, aborting.')\n \n+def check_coredumps(path, remote):\n+    \"\"\"\n+    Pul ELFs (debug and stripped) for each coredump found\n+    \"\"\"\n+    #Check for Coredumps:\n+    coredump_path = os.path.join(path, 'coredump')\n+    if os.path.isdir(coredump_path):\n+        log.info('Transferring binaries for coredumps...')\n+        for dump in os.listdir(coredump_path):\n+            # Pull program from core file\n+            dump_path = os.path.join(coredump_path, dump)\n+            dump_info = subprocess.Popen(['file', dump_path], stdout=subprocess.PIPE)\n+            dump_out = dump_info.communicate()\n+\n+            # Parse file output to get program, Example output:\n+            # 1422917770.7450.core: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, \\\n+            # from 'radosgw --rgw-socket-path /home/ubuntu/cephtest/apache/tmp.client.0/fastcgi_soc'\n+            dump_program = dump_out.split(\"from '\")[1].split(' ')[0]\n+\n+            # Find path on remote server:\n+            r = remote.run(args=['which', dump_program], stdout=StringIO())\n+            remote_path = r.stdout.getvalue()\n+\n+            # Pull remote program into coredump folder:\n+            remote._sftp_get_file(remote_path, os.path.join(coredump_path, dump_program))\n+\n+            # Pull Debug symbols:\n+            # RPM distro's append their non-stripped ELF's with .debug\n+            # When deb based distro's do not.\n+            debug_program = '{dump_program}.debug'.format(dump_program=dump_program)\n+            debug_path = os.path.join('/usr/lib/debug', remote_path)\n+\n+            if remote.system_type == 'rpm':\n+                debug_path = '{debug_path}.debug'.format(debug_path=debug_path)\n+\n+            remote._sftp_get_file(debug_path, os.path.join(coredump_path, debug_program))","path":"teuthology/task/internal.py","position":39,"original_position":39,"commit_id":"7d6e27c43769c76e3296bf6ce279394cc3077453","original_commit_id":"99a27225b9b3d0b05d08d784f480f240cdb6037c","user":{"login":"zmc","id":58307,"avatar_url":"https://avatars.githubusercontent.com/u/58307?v=3","gravatar_id":"","url":"https://api.github.com/users/zmc","html_url":"https://github.com/zmc","followers_url":"https://api.github.com/users/zmc/followers","following_url":"https://api.github.com/users/zmc/following{/other_user}","gists_url":"https://api.github.com/users/zmc/gists{/gist_id}","starred_url":"https://api.github.com/users/zmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmc/subscriptions","organizations_url":"https://api.github.com/users/zmc/orgs","repos_url":"https://api.github.com/users/zmc/repos","events_url":"https://api.github.com/users/zmc/events{/privacy}","received_events_url":"https://api.github.com/users/zmc/received_events","type":"User","site_admin":false},"body":"Ah, okay. Well, I agree the behavior of ``Remote.get_file()`` is a bit wonky but I don't want to necessarily support calling semi-private functions like this. I think it'd be worth me taking a few minutes to make ``Remote.get_file()`` behave in a more sane way so that you can use it.\r\n\r\nWhat if it first tried to store the file locally in the ``dest_dir`` using the original filename, and if that was already taken, called ``mkstemp()``?","created_at":"2015-02-17T23:14:50Z","updated_at":"2015-02-17T23:14:50Z","html_url":"https://github.com/ceph/teuthology/pull/424#discussion_r24864746","pull_request_url":"https://api.github.com/repos/ceph/teuthology/pulls/424","_links":{"self":{"href":"https://api.github.com/repos/ceph/teuthology/pulls/comments/24864746"},"html":{"href":"https://github.com/ceph/teuthology/pull/424#discussion_r24864746"},"pull_request":{"href":"https://api.github.com/repos/ceph/teuthology/pulls/424"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/teuthology/pulls/424","id":28591216,"html_url":"https://github.com/ceph/teuthology/pull/424","diff_url":"https://github.com/ceph/teuthology/pull/424.diff","patch_url":"https://github.com/ceph/teuthology/pull/424.patch","issue_url":"https://api.github.com/repos/ceph/teuthology/issues/424","number":424,"state":"open","locked":false,"title":"Download ELFs (regular + debug) from remotes when coredump occurs.","user":{"login":"SandonV","id":2229104,"avatar_url":"https://avatars.githubusercontent.com/u/2229104?v=3","gravatar_id":"","url":"https://api.github.com/users/SandonV","html_url":"https://github.com/SandonV","followers_url":"https://api.github.com/users/SandonV/followers","following_url":"https://api.github.com/users/SandonV/following{/other_user}","gists_url":"https://api.github.com/users/SandonV/gists{/gist_id}","starred_url":"https://api.github.com/users/SandonV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SandonV/subscriptions","organizations_url":"https://api.github.com/users/SandonV/orgs","repos_url":"https://api.github.com/users/SandonV/repos","events_url":"https://api.github.com/users/SandonV/events{/privacy}","received_events_url":"https://api.github.com/users/SandonV/received_events","type":"User","site_admin":false},"body":"Per issue #5629\r\n\r\nSince we need the binaries (regular stripped + non-stripped with\r\ndebug symbols) to do debugging this will make it more convinient\r\nfor developers so they don't have to track down the files from\r\nthe specific build in question and instead they will just be\r\nsitting in the archive folder with the coredump files.\r\n\r\nSigned-off-by: Sandon Van Ness <sandon@redhat.com>","created_at":"2015-02-03T21:35:34Z","updated_at":"2015-02-17T23:14:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81c986ea375359eb9cab220251942fc23aa51c09","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/teuthology/pulls/424/commits","review_comments_url":"https://api.github.com/repos/ceph/teuthology/pulls/424/comments","review_comment_url":"https://api.github.com/repos/ceph/teuthology/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ceph/teuthology/issues/424/comments","statuses_url":"https://api.github.com/repos/ceph/teuthology/statuses/7d6e27c43769c76e3296bf6ce279394cc3077453","head":{"label":"ceph:wip-5629","ref":"wip-5629","sha":"7d6e27c43769c76e3296bf6ce279394cc3077453","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2357747,"name":"teuthology","full_name":"ceph/teuthology","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/teuthology","description":"Ceph test suite","fork":false,"url":"https://api.github.com/repos/ceph/teuthology","forks_url":"https://api.github.com/repos/ceph/teuthology/forks","keys_url":"https://api.github.com/repos/ceph/teuthology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/teuthology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/teuthology/teams","hooks_url":"https://api.github.com/repos/ceph/teuthology/hooks","issue_events_url":"https://api.github.com/repos/ceph/teuthology/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/teuthology/events","assignees_url":"https://api.github.com/repos/ceph/teuthology/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/teuthology/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/teuthology/tags","blobs_url":"https://api.github.com/repos/ceph/teuthology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/teuthology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/teuthology/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/teuthology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/teuthology/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/teuthology/languages","stargazers_url":"https://api.github.com/repos/ceph/teuthology/stargazers","contributors_url":"https://api.github.com/repos/ceph/teuthology/contributors","subscribers_url":"https://api.github.com/repos/ceph/teuthology/subscribers","subscription_url":"https://api.github.com/repos/ceph/teuthology/subscription","commits_url":"https://api.github.com/repos/ceph/teuthology/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/teuthology/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/teuthology/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/teuthology/issues/comments/{number}","contents_url":"https://api.github.com/repos/ceph/teuthology/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/teuthology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/teuthology/merges","archive_url":"https://api.github.com/repos/ceph/teuthology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/teuthology/downloads","issues_url":"https://api.github.com/repos/ceph/teuthology/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/teuthology/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/teuthology/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/teuthology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/teuthology/labels{/name}","releases_url":"https://api.github.com/repos/ceph/teuthology/releases{/id}","created_at":"2011-09-09T20:00:28Z","updated_at":"2015-02-17T20:57:07Z","pushed_at":"2015-02-17T21:21:51Z","git_url":"git://github.com/ceph/teuthology.git","ssh_url":"git@github.com:ceph/teuthology.git","clone_url":"https://github.com/ceph/teuthology.git","svn_url":"https://github.com/ceph/teuthology","homepage":"","size":16475,"stargazers_count":36,"watchers_count":36,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":10,"forks":34,"open_issues":10,"watchers":36,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"27e31a026b81b4f93d56c2af392b71d208cc9c91","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2357747,"name":"teuthology","full_name":"ceph/teuthology","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/teuthology","description":"Ceph test suite","fork":false,"url":"https://api.github.com/repos/ceph/teuthology","forks_url":"https://api.github.com/repos/ceph/teuthology/forks","keys_url":"https://api.github.com/repos/ceph/teuthology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/teuthology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/teuthology/teams","hooks_url":"https://api.github.com/repos/ceph/teuthology/hooks","issue_events_url":"https://api.github.com/repos/ceph/teuthology/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/teuthology/events","assignees_url":"https://api.github.com/repos/ceph/teuthology/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/teuthology/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/teuthology/tags","blobs_url":"https://api.github.com/repos/ceph/teuthology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/teuthology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/teuthology/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/teuthology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/teuthology/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/teuthology/languages","stargazers_url":"https://api.github.com/repos/ceph/teuthology/stargazers","contributors_url":"https://api.github.com/repos/ceph/teuthology/contributors","subscribers_url":"https://api.github.com/repos/ceph/teuthology/subscribers","subscription_url":"https://api.github.com/repos/ceph/teuthology/subscription","commits_url":"https://api.github.com/repos/ceph/teuthology/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/teuthology/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/teuthology/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/teuthology/issues/comments/{number}","contents_url":"https://api.github.com/repos/ceph/teuthology/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/teuthology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/teuthology/merges","archive_url":"https://api.github.com/repos/ceph/teuthology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/teuthology/downloads","issues_url":"https://api.github.com/repos/ceph/teuthology/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/teuthology/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/teuthology/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/teuthology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/teuthology/labels{/name}","releases_url":"https://api.github.com/repos/ceph/teuthology/releases{/id}","created_at":"2011-09-09T20:00:28Z","updated_at":"2015-02-17T20:57:07Z","pushed_at":"2015-02-17T21:21:51Z","git_url":"git://github.com/ceph/teuthology.git","ssh_url":"git@github.com:ceph/teuthology.git","clone_url":"https://github.com/ceph/teuthology.git","svn_url":"https://github.com/ceph/teuthology","homepage":"","size":16475,"stargazers_count":36,"watchers_count":36,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":10,"forks":34,"open_issues":10,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/teuthology/pulls/424"},"html":{"href":"https://github.com/ceph/teuthology/pull/424"},"issue":{"href":"https://api.github.com/repos/ceph/teuthology/issues/424"},"comments":{"href":"https://api.github.com/repos/ceph/teuthology/issues/424/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/teuthology/pulls/424/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/teuthology/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ceph/teuthology/pulls/424/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/teuthology/statuses/7d6e27c43769c76e3296bf6ce279394cc3077453"}}}}