{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph-installer/pulls/comments/53948582","id":53948582,"diff_hunk":"@@ -38,6 +38,38 @@ def generate_inventory_file(inventory, task_uuid, tmp_dir=None):\n     return inventory_file.name\n \n \n+def parse_monitors(monitors):\n+    \"\"\"\n+    Given a list of dictionaries, returns a list of hosts that\n+    can be used in an ansible inventory. These host lines can include\n+    host variables as well.\n+\n+    For example, monitors in this format:\n+\n+        [\n+            {\"host\": \"mon0.host\", \"interface\": \"eth0\"},\n+            {\"host\": \"mon1.host\", \"interface\": \"enp0s8\"},\n+        ]\n+\n+    Would return the following:\n+\n+        [\"mon0.host monitor_interface=eth0\", \"mon1.host monitor_interface=enp0s8\"]\n+    \"\"\"\n+    hosts = []\n+    var_map = dict(\n+        interface=\"monitor_interface\",\n+    )\n+    for mon in monitors:\n+        host = []\n+        host.append(mon[\"host\"])\n+        for k, v in var_map.iteritems():","path":"ceph_installer/util.py","position":28,"original_position":28,"commit_id":"465e0c6ee67fdca1a9b0126a4377ffa5e2eb2c09","original_commit_id":"465e0c6ee67fdca1a9b0126a4377ffa5e2eb2c09","user":{"login":"andrewschoen","id":20618,"avatar_url":"https://avatars.githubusercontent.com/u/20618?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewschoen","html_url":"https://github.com/andrewschoen","followers_url":"https://api.github.com/users/andrewschoen/followers","following_url":"https://api.github.com/users/andrewschoen/following{/other_user}","gists_url":"https://api.github.com/users/andrewschoen/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewschoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewschoen/subscriptions","organizations_url":"https://api.github.com/users/andrewschoen/orgs","repos_url":"https://api.github.com/users/andrewschoen/repos","events_url":"https://api.github.com/users/andrewschoen/events{/privacy}","received_events_url":"https://api.github.com/users/andrewschoen/received_events","type":"User","site_admin":false},"body":"Yeah, that was the thought anyway. I can't think of one off the top of my head at the moment though.","created_at":"2016-02-24T14:51:48Z","updated_at":"2016-02-24T14:51:48Z","html_url":"https://github.com/ceph/ceph-installer/pull/71#discussion_r53948582","pull_request_url":"https://api.github.com/repos/ceph/ceph-installer/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-installer/pulls/comments/53948582"},"html":{"href":"https://github.com/ceph/ceph-installer/pull/71#discussion_r53948582"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph-installer/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph-installer/pulls/71","id":60424296,"html_url":"https://github.com/ceph/ceph-installer/pull/71","diff_url":"https://github.com/ceph/ceph-installer/pull/71.diff","patch_url":"https://github.com/ceph/ceph-installer/pull/71.patch","issue_url":"https://api.github.com/repos/ceph/ceph-installer/issues/71","number":71,"state":"open","locked":false,"title":"changes needed to support adding a mon to an existing cluster","user":{"login":"andrewschoen","id":20618,"avatar_url":"https://avatars.githubusercontent.com/u/20618?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewschoen","html_url":"https://github.com/andrewschoen","followers_url":"https://api.github.com/users/andrewschoen/followers","following_url":"https://api.github.com/users/andrewschoen/following{/other_user}","gists_url":"https://api.github.com/users/andrewschoen/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewschoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewschoen/subscriptions","organizations_url":"https://api.github.com/users/andrewschoen/orgs","repos_url":"https://api.github.com/users/andrewschoen/repos","events_url":"https://api.github.com/users/andrewschoen/events{/privacy}","received_events_url":"https://api.github.com/users/andrewschoen/received_events","type":"User","site_admin":false},"body":"Docs are not updated here, I'll do that after #70 is merged.","created_at":"2016-02-23T22:48:36Z","updated_at":"2016-02-24T14:51:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"837ec49e780863883b44f70c6faa5cee1baa100a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph-installer/pulls/71/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph-installer/pulls/71/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph-installer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph-installer/issues/71/comments","statuses_url":"https://api.github.com/repos/ceph/ceph-installer/statuses/465e0c6ee67fdca1a9b0126a4377ffa5e2eb2c09","head":{"label":"ceph:mon-addition","ref":"mon-addition","sha":"465e0c6ee67fdca1a9b0126a4377ffa5e2eb2c09","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":35046025,"name":"ceph-installer","full_name":"ceph/ceph-installer","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/ceph-installer","description":"A service to provision Ceph clusters","fork":false,"url":"https://api.github.com/repos/ceph/ceph-installer","forks_url":"https://api.github.com/repos/ceph/ceph-installer/forks","keys_url":"https://api.github.com/repos/ceph/ceph-installer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph-installer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph-installer/teams","hooks_url":"https://api.github.com/repos/ceph/ceph-installer/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph-installer/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph-installer/events","assignees_url":"https://api.github.com/repos/ceph/ceph-installer/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph-installer/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph-installer/tags","blobs_url":"https://api.github.com/repos/ceph/ceph-installer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph-installer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph-installer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph-installer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph-installer/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph-installer/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph-installer/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph-installer/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph-installer/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph-installer/subscription","commits_url":"https://api.github.com/repos/ceph/ceph-installer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph-installer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph-installer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph-installer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph-installer/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph-installer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph-installer/merges","archive_url":"https://api.github.com/repos/ceph/ceph-installer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph-installer/downloads","issues_url":"https://api.github.com/repos/ceph/ceph-installer/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph-installer/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph-installer/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph-installer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph-installer/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph-installer/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph-installer/deployments","created_at":"2015-05-04T16:29:10Z","updated_at":"2016-02-11T13:17:12Z","pushed_at":"2016-02-24T13:46:19Z","git_url":"git://github.com/ceph/ceph-installer.git","ssh_url":"git@github.com:ceph/ceph-installer.git","clone_url":"https://github.com/ceph/ceph-installer.git","svn_url":"https://github.com/ceph/ceph-installer","homepage":"","size":230,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":13,"forks":2,"open_issues":13,"watchers":1,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"38eef99efe826211918d1f829defa6fe3eb7d347","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":35046025,"name":"ceph-installer","full_name":"ceph/ceph-installer","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/ceph-installer","description":"A service to provision Ceph clusters","fork":false,"url":"https://api.github.com/repos/ceph/ceph-installer","forks_url":"https://api.github.com/repos/ceph/ceph-installer/forks","keys_url":"https://api.github.com/repos/ceph/ceph-installer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph-installer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph-installer/teams","hooks_url":"https://api.github.com/repos/ceph/ceph-installer/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph-installer/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph-installer/events","assignees_url":"https://api.github.com/repos/ceph/ceph-installer/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph-installer/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph-installer/tags","blobs_url":"https://api.github.com/repos/ceph/ceph-installer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph-installer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph-installer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph-installer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph-installer/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph-installer/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph-installer/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph-installer/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph-installer/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph-installer/subscription","commits_url":"https://api.github.com/repos/ceph/ceph-installer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph-installer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph-installer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph-installer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph-installer/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph-installer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph-installer/merges","archive_url":"https://api.github.com/repos/ceph/ceph-installer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph-installer/downloads","issues_url":"https://api.github.com/repos/ceph/ceph-installer/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph-installer/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph-installer/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph-installer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph-installer/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph-installer/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph-installer/deployments","created_at":"2015-05-04T16:29:10Z","updated_at":"2016-02-11T13:17:12Z","pushed_at":"2016-02-24T13:46:19Z","git_url":"git://github.com/ceph/ceph-installer.git","ssh_url":"git@github.com:ceph/ceph-installer.git","clone_url":"https://github.com/ceph/ceph-installer.git","svn_url":"https://github.com/ceph/ceph-installer","homepage":"","size":230,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":13,"forks":2,"open_issues":13,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-installer/pulls/71"},"html":{"href":"https://github.com/ceph/ceph-installer/pull/71"},"issue":{"href":"https://api.github.com/repos/ceph/ceph-installer/issues/71"},"comments":{"href":"https://api.github.com/repos/ceph/ceph-installer/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph-installer/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph-installer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph-installer/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph-installer/statuses/465e0c6ee67fdca1a9b0126a4377ffa5e2eb2c09"}}}}