{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker-py/pulls/comments/35864434","id":35864434,"diff_hunk":"@@ -518,6 +518,27 @@ def create_host_config(\n     return host_config\n \n \n+def parse_env_file(env_file):\n+    \"\"\"\n+    Reads a line-separated environment file.\n+    The format of each line should be \"key=value\".\n+    \"\"\"\n+    environment = {}\n+\n+    with open(env_file, 'r') as f:\n+        for line in f:\n+            parse_line = line.strip().split('=')\n+            if len(parse_line) == 2 and line[0] != '#':\n+                k = parse_line[0]\n+                v = parse_line[1]\n+                environment[k] = v\n+            elif line[0] != '#':\n+                raise errors.DockerException(\n+                    'Invalid env_file line:\\n{0}'.format(line))","path":"docker/utils/utils.py","position":null,"original_position":20,"commit_id":"6a5832e2f6655835a6b87897d7ec82d6ef5faa50","original_commit_id":"f750eddc34e5356dcfb53c16a7f98a99e817fa53","user":{"login":"vpetersson","id":357664,"avatar_url":"https://avatars.githubusercontent.com/u/357664?v=3","gravatar_id":"","url":"https://api.github.com/users/vpetersson","html_url":"https://github.com/vpetersson","followers_url":"https://api.github.com/users/vpetersson/followers","following_url":"https://api.github.com/users/vpetersson/following{/other_user}","gists_url":"https://api.github.com/users/vpetersson/gists{/gist_id}","starred_url":"https://api.github.com/users/vpetersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpetersson/subscriptions","organizations_url":"https://api.github.com/users/vpetersson/orgs","repos_url":"https://api.github.com/users/vpetersson/repos","events_url":"https://api.github.com/users/vpetersson/events{/privacy}","received_events_url":"https://api.github.com/users/vpetersson/received_events","type":"User","site_admin":false},"body":"Nice! Yes, that's cleaner. Pushed.","created_at":"2015-07-30T12:17:54Z","updated_at":"2015-07-30T12:17:54Z","html_url":"https://github.com/docker/docker-py/pull/695#discussion_r35864434","pull_request_url":"https://api.github.com/repos/docker/docker-py/pulls/695","_links":{"self":{"href":"https://api.github.com/repos/docker/docker-py/pulls/comments/35864434"},"html":{"href":"https://github.com/docker/docker-py/pull/695#discussion_r35864434"},"pull_request":{"href":"https://api.github.com/repos/docker/docker-py/pulls/695"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker-py/pulls/695","id":41019794,"html_url":"https://github.com/docker/docker-py/pull/695","diff_url":"https://github.com/docker/docker-py/pull/695.diff","patch_url":"https://github.com/docker/docker-py/pull/695.patch","issue_url":"https://api.github.com/repos/docker/docker-py/issues/695","number":695,"state":"open","locked":false,"title":"Ports `--env-file` in minimalistic fashion","user":{"login":"vpetersson","id":357664,"avatar_url":"https://avatars.githubusercontent.com/u/357664?v=3","gravatar_id":"","url":"https://api.github.com/users/vpetersson","html_url":"https://github.com/vpetersson","followers_url":"https://api.github.com/users/vpetersson/followers","following_url":"https://api.github.com/users/vpetersson/following{/other_user}","gists_url":"https://api.github.com/users/vpetersson/gists{/gist_id}","starred_url":"https://api.github.com/users/vpetersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpetersson/subscriptions","organizations_url":"https://api.github.com/users/vpetersson/orgs","repos_url":"https://api.github.com/users/vpetersson/repos","events_url":"https://api.github.com/users/vpetersson/events{/privacy}","received_events_url":"https://api.github.com/users/vpetersson/received_events","type":"User","site_admin":false},"body":"Refs #565. Adds support for providing environment variables from a file instead of manually providing them one-by-one. ","created_at":"2015-07-28T14:46:52Z","updated_at":"2015-07-30T12:17:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e16cea2eb27a7fa5472e88fe74e936c69d30ec4a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker-py/pulls/695/commits","review_comments_url":"https://api.github.com/repos/docker/docker-py/pulls/695/comments","review_comment_url":"https://api.github.com/repos/docker/docker-py/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker-py/issues/695/comments","statuses_url":"https://api.github.com/repos/docker/docker-py/statuses/6a5832e2f6655835a6b87897d7ec82d6ef5faa50","head":{"label":"vpetersson:master","ref":"master","sha":"6a5832e2f6655835a6b87897d7ec82d6ef5faa50","user":{"login":"vpetersson","id":357664,"avatar_url":"https://avatars.githubusercontent.com/u/357664?v=3","gravatar_id":"","url":"https://api.github.com/users/vpetersson","html_url":"https://github.com/vpetersson","followers_url":"https://api.github.com/users/vpetersson/followers","following_url":"https://api.github.com/users/vpetersson/following{/other_user}","gists_url":"https://api.github.com/users/vpetersson/gists{/gist_id}","starred_url":"https://api.github.com/users/vpetersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpetersson/subscriptions","organizations_url":"https://api.github.com/users/vpetersson/orgs","repos_url":"https://api.github.com/users/vpetersson/repos","events_url":"https://api.github.com/users/vpetersson/events{/privacy}","received_events_url":"https://api.github.com/users/vpetersson/received_events","type":"User","site_admin":false},"repo":{"id":39833079,"name":"docker-py","full_name":"vpetersson/docker-py","owner":{"login":"vpetersson","id":357664,"avatar_url":"https://avatars.githubusercontent.com/u/357664?v=3","gravatar_id":"","url":"https://api.github.com/users/vpetersson","html_url":"https://github.com/vpetersson","followers_url":"https://api.github.com/users/vpetersson/followers","following_url":"https://api.github.com/users/vpetersson/following{/other_user}","gists_url":"https://api.github.com/users/vpetersson/gists{/gist_id}","starred_url":"https://api.github.com/users/vpetersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpetersson/subscriptions","organizations_url":"https://api.github.com/users/vpetersson/orgs","repos_url":"https://api.github.com/users/vpetersson/repos","events_url":"https://api.github.com/users/vpetersson/events{/privacy}","received_events_url":"https://api.github.com/users/vpetersson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vpetersson/docker-py","description":"An API client for docker written in Python","fork":true,"url":"https://api.github.com/repos/vpetersson/docker-py","forks_url":"https://api.github.com/repos/vpetersson/docker-py/forks","keys_url":"https://api.github.com/repos/vpetersson/docker-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vpetersson/docker-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vpetersson/docker-py/teams","hooks_url":"https://api.github.com/repos/vpetersson/docker-py/hooks","issue_events_url":"https://api.github.com/repos/vpetersson/docker-py/issues/events{/number}","events_url":"https://api.github.com/repos/vpetersson/docker-py/events","assignees_url":"https://api.github.com/repos/vpetersson/docker-py/assignees{/user}","branches_url":"https://api.github.com/repos/vpetersson/docker-py/branches{/branch}","tags_url":"https://api.github.com/repos/vpetersson/docker-py/tags","blobs_url":"https://api.github.com/repos/vpetersson/docker-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vpetersson/docker-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vpetersson/docker-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/vpetersson/docker-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vpetersson/docker-py/statuses/{sha}","languages_url":"https://api.github.com/repos/vpetersson/docker-py/languages","stargazers_url":"https://api.github.com/repos/vpetersson/docker-py/stargazers","contributors_url":"https://api.github.com/repos/vpetersson/docker-py/contributors","subscribers_url":"https://api.github.com/repos/vpetersson/docker-py/subscribers","subscription_url":"https://api.github.com/repos/vpetersson/docker-py/subscription","commits_url":"https://api.github.com/repos/vpetersson/docker-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/vpetersson/docker-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/vpetersson/docker-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/vpetersson/docker-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/vpetersson/docker-py/contents/{+path}","compare_url":"https://api.github.com/repos/vpetersson/docker-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vpetersson/docker-py/merges","archive_url":"https://api.github.com/repos/vpetersson/docker-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vpetersson/docker-py/downloads","issues_url":"https://api.github.com/repos/vpetersson/docker-py/issues{/number}","pulls_url":"https://api.github.com/repos/vpetersson/docker-py/pulls{/number}","milestones_url":"https://api.github.com/repos/vpetersson/docker-py/milestones{/number}","notifications_url":"https://api.github.com/repos/vpetersson/docker-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vpetersson/docker-py/labels{/name}","releases_url":"https://api.github.com/repos/vpetersson/docker-py/releases{/id}","created_at":"2015-07-28T12:40:23Z","updated_at":"2015-07-28T12:40:24Z","pushed_at":"2015-07-30T12:17:39Z","git_url":"git://github.com/vpetersson/docker-py.git","ssh_url":"git@github.com:vpetersson/docker-py.git","clone_url":"https://github.com/vpetersson/docker-py.git","svn_url":"https://github.com/vpetersson/docker-py","homepage":"","size":5118,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"docker:master","ref":"master","sha":"70dd6548428bc7b893be5cc7b4d9fc6cfc964506","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":10247874,"name":"docker-py","full_name":"docker/docker-py","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker-py","description":"An API client for docker written in Python","fork":false,"url":"https://api.github.com/repos/docker/docker-py","forks_url":"https://api.github.com/repos/docker/docker-py/forks","keys_url":"https://api.github.com/repos/docker/docker-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker-py/teams","hooks_url":"https://api.github.com/repos/docker/docker-py/hooks","issue_events_url":"https://api.github.com/repos/docker/docker-py/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker-py/events","assignees_url":"https://api.github.com/repos/docker/docker-py/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker-py/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker-py/tags","blobs_url":"https://api.github.com/repos/docker/docker-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker-py/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker-py/languages","stargazers_url":"https://api.github.com/repos/docker/docker-py/stargazers","contributors_url":"https://api.github.com/repos/docker/docker-py/contributors","subscribers_url":"https://api.github.com/repos/docker/docker-py/subscribers","subscription_url":"https://api.github.com/repos/docker/docker-py/subscription","commits_url":"https://api.github.com/repos/docker/docker-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker-py/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker-py/merges","archive_url":"https://api.github.com/repos/docker/docker-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker-py/downloads","issues_url":"https://api.github.com/repos/docker/docker-py/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker-py/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker-py/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker-py/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker-py/releases{/id}","created_at":"2013-05-23T16:15:07Z","updated_at":"2015-07-30T10:12:52Z","pushed_at":"2015-07-30T12:17:40Z","git_url":"git://github.com/docker/docker-py.git","ssh_url":"git@github.com:docker/docker-py.git","clone_url":"https://github.com/docker/docker-py.git","svn_url":"https://github.com/docker/docker-py","homepage":"","size":5118,"stargazers_count":1019,"watchers_count":1019,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":388,"mirror_url":null,"open_issues_count":62,"forks":388,"open_issues":62,"watchers":1019,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker-py/pulls/695"},"html":{"href":"https://github.com/docker/docker-py/pull/695"},"issue":{"href":"https://api.github.com/repos/docker/docker-py/issues/695"},"comments":{"href":"https://api.github.com/repos/docker/docker-py/issues/695/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker-py/pulls/695/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker-py/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker-py/pulls/695/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker-py/statuses/6a5832e2f6655835a6b87897d7ec82d6ef5faa50"}}}}