{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/comments/25948420","id":25948420,"diff_hunk":"@@ -72,6 +72,51 @@ if test $CROWBAR_FORCE -ne 1; then\n     fi\n fi\n \n+# Helper functions\n+# ----------------\n+\n+post_allocate() {\n+  local curlargs=(--connect-timeout 60 -s \\\n+                  -L -X POST --data-binary \"{ \\\"name\\\": \\\"$1\\\" }\" \\\n+                  -H \"Accept: application/json\" -H \"Content-Type: application/json\" \\\n+                  --max-time 240)\n+\n+  [[ $CROWBAR_KEY ]] && curlargs+=(-u \"$CROWBAR_KEY\" --digest --anyauth)\n+\n+  curl \"${curlargs[@]}\" \"http://$ADMIN_IP:3000/crowbar/machines/1.0/allocate/0\"\n+}\n+\n+post_state() {\n+  local curlargs=(-o \"/var/log/crowbar/$1-$2.json\" --connect-timeout 60 -s \\\n+                  -L -X POST --data-binary \"{ \\\"name\\\": \\\"$1\\\", \\\"state\\\": \\\"$2\\\" }\" \\\n+                  -H \"Accept: application/json\" -H \"Content-Type: application/json\" \\\n+                  --max-time 240)\n+\n+  [[ $CROWBAR_KEY ]] && curlargs+=(-u \"$CROWBAR_KEY\" --digest --anyauth)\n+\n+  curl \"${curlargs[@]}\" \"http://$ADMIN_IP:3000/crowbar/crowbar/1.0/transition/default\"\n+}\n+\n+add_group() {\n+  gid=$(getent group $1 | cut -f 3 -d \":\")\n+  if [[ -z \"$gid\" ]]; then\n+    groupadd --system --gid $2 $1\n+  elif [[ \"$gid\" != \"$2\" ]]; then\n+    echo \"Group $1 did not have gid $2.\"","path":"chef/cookbooks/provisioner/templates/suse/crowbar_register.erb","position":34,"original_position":34,"commit_id":"c4dbdc23541c11e51703dd6509c8be3ef86162f4","original_commit_id":"c4dbdc23541c11e51703dd6509c8be3ef86162f4","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"body":"s/did/does/","created_at":"2015-03-06T14:46:40Z","updated_at":"2015-03-06T14:46:40Z","html_url":"https://github.com/crowbar/barclamp-provisioner/pull/402#discussion_r25948420","pull_request_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402","_links":{"self":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/comments/25948420"},"html":{"href":"https://github.com/crowbar/barclamp-provisioner/pull/402#discussion_r25948420"},"pull_request":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402","id":30481083,"html_url":"https://github.com/crowbar/barclamp-provisioner/pull/402","diff_url":"https://github.com/crowbar/barclamp-provisioner/pull/402.diff","patch_url":"https://github.com/crowbar/barclamp-provisioner/pull/402.patch","issue_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/issues/402","number":402,"state":"open","locked":false,"title":"Add kvm and qemu user/group with fixed id's","user":{"login":"rsalevsky","id":4128547,"avatar_url":"https://avatars.githubusercontent.com/u/4128547?v=3","gravatar_id":"","url":"https://api.github.com/users/rsalevsky","html_url":"https://github.com/rsalevsky","followers_url":"https://api.github.com/users/rsalevsky/followers","following_url":"https://api.github.com/users/rsalevsky/following{/other_user}","gists_url":"https://api.github.com/users/rsalevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/rsalevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsalevsky/subscriptions","organizations_url":"https://api.github.com/users/rsalevsky/orgs","repos_url":"https://api.github.com/users/rsalevsky/repos","events_url":"https://api.github.com/users/rsalevsky/events{/privacy}","received_events_url":"https://api.github.com/users/rsalevsky/received_events","type":"User","site_admin":false},"body":"Add kvm and qemu user/group with fixed uid/gid while\r\ncrowbar_register.","created_at":"2015-03-04T16:36:58Z","updated_at":"2015-03-06T14:46:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"768d7e732a5f05d8575145f797d906dab9d5d4f4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402/commits","review_comments_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402/comments","review_comment_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/issues/402/comments","statuses_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/statuses/c4dbdc23541c11e51703dd6509c8be3ef86162f4","head":{"label":"rsalevsky:crowbar_register_users","ref":"crowbar_register_users","sha":"c4dbdc23541c11e51703dd6509c8be3ef86162f4","user":{"login":"rsalevsky","id":4128547,"avatar_url":"https://avatars.githubusercontent.com/u/4128547?v=3","gravatar_id":"","url":"https://api.github.com/users/rsalevsky","html_url":"https://github.com/rsalevsky","followers_url":"https://api.github.com/users/rsalevsky/followers","following_url":"https://api.github.com/users/rsalevsky/following{/other_user}","gists_url":"https://api.github.com/users/rsalevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/rsalevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsalevsky/subscriptions","organizations_url":"https://api.github.com/users/rsalevsky/orgs","repos_url":"https://api.github.com/users/rsalevsky/repos","events_url":"https://api.github.com/users/rsalevsky/events{/privacy}","received_events_url":"https://api.github.com/users/rsalevsky/received_events","type":"User","site_admin":false},"repo":{"id":31014904,"name":"barclamp-provisioner","full_name":"rsalevsky/barclamp-provisioner","owner":{"login":"rsalevsky","id":4128547,"avatar_url":"https://avatars.githubusercontent.com/u/4128547?v=3","gravatar_id":"","url":"https://api.github.com/users/rsalevsky","html_url":"https://github.com/rsalevsky","followers_url":"https://api.github.com/users/rsalevsky/followers","following_url":"https://api.github.com/users/rsalevsky/following{/other_user}","gists_url":"https://api.github.com/users/rsalevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/rsalevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsalevsky/subscriptions","organizations_url":"https://api.github.com/users/rsalevsky/orgs","repos_url":"https://api.github.com/users/rsalevsky/repos","events_url":"https://api.github.com/users/rsalevsky/events{/privacy}","received_events_url":"https://api.github.com/users/rsalevsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rsalevsky/barclamp-provisioner","description":"Crowbar Provisioner: Install Operating Systems","fork":true,"url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner","forks_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/forks","keys_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/teams","hooks_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/hooks","issue_events_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/issues/events{/number}","events_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/events","assignees_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/assignees{/user}","branches_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/branches{/branch}","tags_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/tags","blobs_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/git/refs{/sha}","trees_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/statuses/{sha}","languages_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/languages","stargazers_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/stargazers","contributors_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/contributors","subscribers_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/subscribers","subscription_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/subscription","commits_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/commits{/sha}","git_commits_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/git/commits{/sha}","comments_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/comments{/number}","issue_comment_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/issues/comments{/number}","contents_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/contents/{+path}","compare_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/merges","archive_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/downloads","issues_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/issues{/number}","pulls_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/pulls{/number}","milestones_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/milestones{/number}","notifications_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/labels{/name}","releases_url":"https://api.github.com/repos/rsalevsky/barclamp-provisioner/releases{/id}","created_at":"2015-02-19T12:47:31Z","updated_at":"2015-03-04T16:35:17Z","pushed_at":"2015-03-06T09:40:43Z","git_url":"git://github.com/rsalevsky/barclamp-provisioner.git","ssh_url":"git@github.com:rsalevsky/barclamp-provisioner.git","clone_url":"https://github.com/rsalevsky/barclamp-provisioner.git","svn_url":"https://github.com/rsalevsky/barclamp-provisioner","homepage":"https://github.com/crowbar/crowbar","size":64396,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"crowbar:master","ref":"master","sha":"37573792e672007152aba2330a504704a33055eb","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":2351609,"name":"barclamp-provisioner","full_name":"crowbar/barclamp-provisioner","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/barclamp-provisioner","description":"Crowbar Provisioner: Install Operating Systems","fork":false,"url":"https://api.github.com/repos/crowbar/barclamp-provisioner","forks_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/forks","keys_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/teams","hooks_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/hooks","issue_events_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/events","assignees_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/tags","blobs_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/languages","stargazers_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/stargazers","contributors_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/contributors","subscribers_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/subscribers","subscription_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/subscription","commits_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/merges","archive_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/downloads","issues_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/barclamp-provisioner/releases{/id}","created_at":"2011-09-08T21:20:51Z","updated_at":"2015-03-05T16:41:29Z","pushed_at":"2015-03-05T16:41:29Z","git_url":"git://github.com/crowbar/barclamp-provisioner.git","ssh_url":"git@github.com:crowbar/barclamp-provisioner.git","clone_url":"https://github.com/crowbar/barclamp-provisioner.git","svn_url":"https://github.com/crowbar/barclamp-provisioner","homepage":"https://github.com/crowbar/crowbar","size":66468,"stargazers_count":60,"watchers_count":60,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":186,"mirror_url":null,"open_issues_count":11,"forks":186,"open_issues":11,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402"},"html":{"href":"https://github.com/crowbar/barclamp-provisioner/pull/402"},"issue":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/issues/402"},"comments":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/issues/402/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/pulls/402/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/barclamp-provisioner/statuses/c4dbdc23541c11e51703dd6509c8be3ef86162f4"}}}}