{"action":"created","comment":{"url":"https://api.github.com/repos/spotify/luigi/pulls/comments/29992166","id":29992166,"diff_hunk":"@@ -0,0 +1,288 @@\n+# -*- coding: utf-8 -*-\n+#\n+# Copyright 2012-2015 Spotify AB\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+# http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+\n+\"\"\"\n+The implementations of the hdfs clients. The hadoop cli client and the\n+snakebite client.\n+\"\"\"\n+\n+\n+from luigi.target import FileAlreadyExists, FileSystem\n+from luigi.contrib.hdfs.config import load_hadoop_cmd\n+from luigi.contrib.hdfs import config as hdfs_config\n+from luigi.contrib.hdfs import error as hdfs_error\n+import logging\n+import subprocess\n+import datetime\n+import os\n+import re\n+import warnings\n+\n+logger = logging.getLogger('luigi-interface')\n+\n+\n+def create_hadoopcli_client():\n+    \"\"\"\n+    Given that we want one of the hadoop cli clients (unlike snakebite),\n+    this one will return the right one.\n+    \"\"\"\n+    version = hdfs_config.get_configured_hadoop_version()\n+    if version == \"cdh4\":\n+        return HdfsClient()\n+    elif version == \"cdh3\":\n+        return HdfsClientCdh3()\n+    elif version == \"apache1\":\n+        return HdfsClientApache1()\n+    else:\n+        raise Exception(\"Error: Unknown version specified in Hadoop version\"","path":"luigi/contrib/hdfs/hadoopcli_clients.py","position":51,"original_position":51,"commit_id":"cae0da529589a5b52be1bdb4236fde301b060099","original_commit_id":"cae0da529589a5b52be1bdb4236fde301b060099","user":{"login":"berkerpeksag","id":26338,"avatar_url":"https://avatars.githubusercontent.com/u/26338?v=3","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"body":"Nitpick: This could be a ValueError, too.","created_at":"2015-05-09T12:05:39Z","updated_at":"2015-05-09T12:05:39Z","html_url":"https://github.com/spotify/luigi/pull/937#discussion_r29992166","pull_request_url":"https://api.github.com/repos/spotify/luigi/pulls/937","_links":{"self":{"href":"https://api.github.com/repos/spotify/luigi/pulls/comments/29992166"},"html":{"href":"https://github.com/spotify/luigi/pull/937#discussion_r29992166"},"pull_request":{"href":"https://api.github.com/repos/spotify/luigi/pulls/937"}}},"pull_request":{"url":"https://api.github.com/repos/spotify/luigi/pulls/937","id":34910805,"html_url":"https://github.com/spotify/luigi/pull/937","diff_url":"https://github.com/spotify/luigi/pull/937.diff","patch_url":"https://github.com/spotify/luigi/pull/937.patch","issue_url":"https://api.github.com/repos/spotify/luigi/issues/937","number":937,"state":"open","locked":false,"title":"Split up hdfs clients","user":{"login":"Tarrasch","id":294349,"avatar_url":"https://avatars.githubusercontent.com/u/294349?v=3","gravatar_id":"","url":"https://api.github.com/users/Tarrasch","html_url":"https://github.com/Tarrasch","followers_url":"https://api.github.com/users/Tarrasch/followers","following_url":"https://api.github.com/users/Tarrasch/following{/other_user}","gists_url":"https://api.github.com/users/Tarrasch/gists{/gist_id}","starred_url":"https://api.github.com/users/Tarrasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tarrasch/subscriptions","organizations_url":"https://api.github.com/users/Tarrasch/orgs","repos_url":"https://api.github.com/users/Tarrasch/repos","events_url":"https://api.github.com/users/Tarrasch/events{/privacy}","received_events_url":"https://api.github.com/users/Tarrasch/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-07T12:36:43Z","updated_at":"2015-05-09T12:05:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce4a709994043ea1951075411fe81e253ac73131","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spotify/luigi/pulls/937/commits","review_comments_url":"https://api.github.com/repos/spotify/luigi/pulls/937/comments","review_comment_url":"https://api.github.com/repos/spotify/luigi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spotify/luigi/issues/937/comments","statuses_url":"https://api.github.com/repos/spotify/luigi/statuses/cae0da529589a5b52be1bdb4236fde301b060099","head":{"label":"Tarrasch:split-up-hdfs-clients","ref":"split-up-hdfs-clients","sha":"cae0da529589a5b52be1bdb4236fde301b060099","user":{"login":"Tarrasch","id":294349,"avatar_url":"https://avatars.githubusercontent.com/u/294349?v=3","gravatar_id":"","url":"https://api.github.com/users/Tarrasch","html_url":"https://github.com/Tarrasch","followers_url":"https://api.github.com/users/Tarrasch/followers","following_url":"https://api.github.com/users/Tarrasch/following{/other_user}","gists_url":"https://api.github.com/users/Tarrasch/gists{/gist_id}","starred_url":"https://api.github.com/users/Tarrasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tarrasch/subscriptions","organizations_url":"https://api.github.com/users/Tarrasch/orgs","repos_url":"https://api.github.com/users/Tarrasch/repos","events_url":"https://api.github.com/users/Tarrasch/events{/privacy}","received_events_url":"https://api.github.com/users/Tarrasch/received_events","type":"User","site_admin":false},"repo":{"id":21271283,"name":"luigi","full_name":"Tarrasch/luigi","owner":{"login":"Tarrasch","id":294349,"avatar_url":"https://avatars.githubusercontent.com/u/294349?v=3","gravatar_id":"","url":"https://api.github.com/users/Tarrasch","html_url":"https://github.com/Tarrasch","followers_url":"https://api.github.com/users/Tarrasch/followers","following_url":"https://api.github.com/users/Tarrasch/following{/other_user}","gists_url":"https://api.github.com/users/Tarrasch/gists{/gist_id}","starred_url":"https://api.github.com/users/Tarrasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tarrasch/subscriptions","organizations_url":"https://api.github.com/users/Tarrasch/orgs","repos_url":"https://api.github.com/users/Tarrasch/repos","events_url":"https://api.github.com/users/Tarrasch/events{/privacy}","received_events_url":"https://api.github.com/users/Tarrasch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tarrasch/luigi","description":"Luigi is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualization etc. It also comes with Hadoop support built in. ","fork":true,"url":"https://api.github.com/repos/Tarrasch/luigi","forks_url":"https://api.github.com/repos/Tarrasch/luigi/forks","keys_url":"https://api.github.com/repos/Tarrasch/luigi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tarrasch/luigi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tarrasch/luigi/teams","hooks_url":"https://api.github.com/repos/Tarrasch/luigi/hooks","issue_events_url":"https://api.github.com/repos/Tarrasch/luigi/issues/events{/number}","events_url":"https://api.github.com/repos/Tarrasch/luigi/events","assignees_url":"https://api.github.com/repos/Tarrasch/luigi/assignees{/user}","branches_url":"https://api.github.com/repos/Tarrasch/luigi/branches{/branch}","tags_url":"https://api.github.com/repos/Tarrasch/luigi/tags","blobs_url":"https://api.github.com/repos/Tarrasch/luigi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tarrasch/luigi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tarrasch/luigi/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tarrasch/luigi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tarrasch/luigi/statuses/{sha}","languages_url":"https://api.github.com/repos/Tarrasch/luigi/languages","stargazers_url":"https://api.github.com/repos/Tarrasch/luigi/stargazers","contributors_url":"https://api.github.com/repos/Tarrasch/luigi/contributors","subscribers_url":"https://api.github.com/repos/Tarrasch/luigi/subscribers","subscription_url":"https://api.github.com/repos/Tarrasch/luigi/subscription","commits_url":"https://api.github.com/repos/Tarrasch/luigi/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tarrasch/luigi/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tarrasch/luigi/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tarrasch/luigi/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tarrasch/luigi/contents/{+path}","compare_url":"https://api.github.com/repos/Tarrasch/luigi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tarrasch/luigi/merges","archive_url":"https://api.github.com/repos/Tarrasch/luigi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tarrasch/luigi/downloads","issues_url":"https://api.github.com/repos/Tarrasch/luigi/issues{/number}","pulls_url":"https://api.github.com/repos/Tarrasch/luigi/pulls{/number}","milestones_url":"https://api.github.com/repos/Tarrasch/luigi/milestones{/number}","notifications_url":"https://api.github.com/repos/Tarrasch/luigi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tarrasch/luigi/labels{/name}","releases_url":"https://api.github.com/repos/Tarrasch/luigi/releases{/id}","created_at":"2014-06-27T09:50:33Z","updated_at":"2015-05-07T12:32:37Z","pushed_at":"2015-05-08T19:39:12Z","git_url":"git://github.com/Tarrasch/luigi.git","ssh_url":"git@github.com:Tarrasch/luigi.git","clone_url":"https://github.com/Tarrasch/luigi.git","svn_url":"https://github.com/Tarrasch/luigi","homepage":null,"size":5540,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spotify:master","ref":"master","sha":"6d8a0ce6e1a6645235a38512a7b730330b8e7a16","user":{"login":"spotify","id":251374,"avatar_url":"https://avatars.githubusercontent.com/u/251374?v=3","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"repo":{"id":5888353,"name":"luigi","full_name":"spotify/luigi","owner":{"login":"spotify","id":251374,"avatar_url":"https://avatars.githubusercontent.com/u/251374?v=3","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spotify/luigi","description":"Luigi is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualization etc. It also comes with Hadoop support built in. ","fork":false,"url":"https://api.github.com/repos/spotify/luigi","forks_url":"https://api.github.com/repos/spotify/luigi/forks","keys_url":"https://api.github.com/repos/spotify/luigi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spotify/luigi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spotify/luigi/teams","hooks_url":"https://api.github.com/repos/spotify/luigi/hooks","issue_events_url":"https://api.github.com/repos/spotify/luigi/issues/events{/number}","events_url":"https://api.github.com/repos/spotify/luigi/events","assignees_url":"https://api.github.com/repos/spotify/luigi/assignees{/user}","branches_url":"https://api.github.com/repos/spotify/luigi/branches{/branch}","tags_url":"https://api.github.com/repos/spotify/luigi/tags","blobs_url":"https://api.github.com/repos/spotify/luigi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spotify/luigi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spotify/luigi/git/refs{/sha}","trees_url":"https://api.github.com/repos/spotify/luigi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spotify/luigi/statuses/{sha}","languages_url":"https://api.github.com/repos/spotify/luigi/languages","stargazers_url":"https://api.github.com/repos/spotify/luigi/stargazers","contributors_url":"https://api.github.com/repos/spotify/luigi/contributors","subscribers_url":"https://api.github.com/repos/spotify/luigi/subscribers","subscription_url":"https://api.github.com/repos/spotify/luigi/subscription","commits_url":"https://api.github.com/repos/spotify/luigi/commits{/sha}","git_commits_url":"https://api.github.com/repos/spotify/luigi/git/commits{/sha}","comments_url":"https://api.github.com/repos/spotify/luigi/comments{/number}","issue_comment_url":"https://api.github.com/repos/spotify/luigi/issues/comments{/number}","contents_url":"https://api.github.com/repos/spotify/luigi/contents/{+path}","compare_url":"https://api.github.com/repos/spotify/luigi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spotify/luigi/merges","archive_url":"https://api.github.com/repos/spotify/luigi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spotify/luigi/downloads","issues_url":"https://api.github.com/repos/spotify/luigi/issues{/number}","pulls_url":"https://api.github.com/repos/spotify/luigi/pulls{/number}","milestones_url":"https://api.github.com/repos/spotify/luigi/milestones{/number}","notifications_url":"https://api.github.com/repos/spotify/luigi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spotify/luigi/labels{/name}","releases_url":"https://api.github.com/repos/spotify/luigi/releases{/id}","created_at":"2012-09-20T15:06:38Z","updated_at":"2015-05-08T21:53:55Z","pushed_at":"2015-05-08T19:39:12Z","git_url":"git://github.com/spotify/luigi.git","ssh_url":"git@github.com:spotify/luigi.git","clone_url":"https://github.com/spotify/luigi.git","svn_url":"https://github.com/spotify/luigi","homepage":null,"size":14403,"stargazers_count":2595,"watchers_count":2595,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":429,"mirror_url":null,"open_issues_count":78,"forks":429,"open_issues":78,"watchers":2595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spotify/luigi/pulls/937"},"html":{"href":"https://github.com/spotify/luigi/pull/937"},"issue":{"href":"https://api.github.com/repos/spotify/luigi/issues/937"},"comments":{"href":"https://api.github.com/repos/spotify/luigi/issues/937/comments"},"review_comments":{"href":"https://api.github.com/repos/spotify/luigi/pulls/937/comments"},"review_comment":{"href":"https://api.github.com/repos/spotify/luigi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spotify/luigi/pulls/937/commits"},"statuses":{"href":"https://api.github.com/repos/spotify/luigi/statuses/cae0da529589a5b52be1bdb4236fde301b060099"}}}}