{"action":"created","comment":{"url":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments/64751492","id":64751492,"diff_hunk":"@@ -22,68 +22,119 @@ import (\n \t\"io\"\n \t\"log\"\n \t\"os/exec\"\n+\t\"strconv\"\n \t\"strings\"\n+\t\"time\"\n )\n \n-func PuppetConfig(puppetParameter, puppetConf string) *GraphConfig {\n-\tvar puppetConfArg string\n-\tif puppetConf != \"\" {\n-\t\tpuppetConfArg = \"--config=\" + puppetConf\n-\t}\n-\n-\tvar cmd *exec.Cmd\n-\tif puppetParameter == \"agent\" {\n-\t\tcmd = exec.Command(\"puppet\", \"mgmtgraph\", \"print\", puppetConfArg)\n-\t} else if strings.HasSuffix(puppetParameter, \".pp\") {\n-\t\tcmd = exec.Command(\"puppet\", \"mgmtgraph\", \"print\", puppetConfArg, \"--manifest\", puppetParameter)\n-\t} else {\n-\t\tcmd = exec.Command(\"puppet\", \"mgmtgraph\", \"print\", puppetConfArg, \"--code\", puppetParameter)\n-\t}\n+const (\n+\tPUPPET_YAML_BUFFER_SIZE = 65535","path":"puppet.go","position":null,"original_position":24,"commit_id":"3ebaaf6a515f926113cf2fc820187a3f001d5233","original_commit_id":"3ebaaf6a515f926113cf2fc820187a3f001d5233","user":{"login":"ffrank","id":436765,"avatar_url":"https://avatars.githubusercontent.com/u/436765?v=3","gravatar_id":"","url":"https://api.github.com/users/ffrank","html_url":"https://github.com/ffrank","followers_url":"https://api.github.com/users/ffrank/followers","following_url":"https://api.github.com/users/ffrank/following{/other_user}","gists_url":"https://api.github.com/users/ffrank/gists{/gist_id}","starred_url":"https://api.github.com/users/ffrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffrank/subscriptions","organizations_url":"https://api.github.com/users/ffrank/orgs","repos_url":"https://api.github.com/users/ffrank/repos","events_url":"https://api.github.com/users/ffrank/events{/privacy}","received_events_url":"https://api.github.com/users/ffrank/received_events","type":"User","site_admin":false},"body":"Actually took the cue from const DEBUG ;)","created_at":"2016-05-26T14:09:18Z","updated_at":"2016-05-26T14:09:18Z","html_url":"https://github.com/purpleidea/mgmt/pull/47#discussion_r64751492","pull_request_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments/64751492"},"html":{"href":"https://github.com/purpleidea/mgmt/pull/47#discussion_r64751492"},"pull_request":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/purpleidea/mgmt/pulls/47","id":71311993,"html_url":"https://github.com/purpleidea/mgmt/pull/47","diff_url":"https://github.com/purpleidea/mgmt/pull/47.diff","patch_url":"https://github.com/purpleidea/mgmt/pull/47.patch","issue_url":"https://api.github.com/repos/purpleidea/mgmt/issues/47","number":47,"state":"open","locked":false,"title":"Puppet integration","user":{"login":"ffrank","id":436765,"avatar_url":"https://avatars.githubusercontent.com/u/436765?v=3","gravatar_id":"","url":"https://api.github.com/users/ffrank","html_url":"https://github.com/ffrank","followers_url":"https://api.github.com/users/ffrank/followers","following_url":"https://api.github.com/users/ffrank/following{/other_user}","gists_url":"https://api.github.com/users/ffrank/gists{/gist_id}","starred_url":"https://api.github.com/users/ffrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffrank/subscriptions","organizations_url":"https://api.github.com/users/ffrank/orgs","repos_url":"https://api.github.com/users/ffrank/repos","events_url":"https://api.github.com/users/ffrank/events{/privacy}","received_events_url":"https://api.github.com/users/ffrank/received_events","type":"User","site_admin":false},"body":"Puppet can be used on the basis of the `ffrank-mgmtgraph` module.\r\nThere are three modes available:\r\n* fetching catalogs from the master (--puppet agent)\r\n* compiling a manifest from a local file (--puppet /path/to/file.pp)\r\n* compiling a manifest from the cli (--puppet \"<manifest>\")\r\n                        \r\nCatalogs from the master are currently never refreshed. We should\r\nadd some more code to re-run the parsing function at an interval\r\nequal to Puppet's local 'runinterval' setting.\r\n                                        \r\nThere is also still a distinct lack of tests.\r\n                                                \r\nStill, this fixes #8","created_at":"2016-05-24T23:59:31Z","updated_at":"2016-05-26T14:09:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"523cfbe477adce8115f69f56ce82bbac97e141cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/47/commits","review_comments_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/47/comments","review_comment_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/purpleidea/mgmt/issues/47/comments","statuses_url":"https://api.github.com/repos/purpleidea/mgmt/statuses/3ebaaf6a515f926113cf2fc820187a3f001d5233","head":{"label":"ffrank:puppet-integration","ref":"puppet-integration","sha":"3ebaaf6a515f926113cf2fc820187a3f001d5233","user":{"login":"ffrank","id":436765,"avatar_url":"https://avatars.githubusercontent.com/u/436765?v=3","gravatar_id":"","url":"https://api.github.com/users/ffrank","html_url":"https://github.com/ffrank","followers_url":"https://api.github.com/users/ffrank/followers","following_url":"https://api.github.com/users/ffrank/following{/other_user}","gists_url":"https://api.github.com/users/ffrank/gists{/gist_id}","starred_url":"https://api.github.com/users/ffrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffrank/subscriptions","organizations_url":"https://api.github.com/users/ffrank/orgs","repos_url":"https://api.github.com/users/ffrank/repos","events_url":"https://api.github.com/users/ffrank/events{/privacy}","received_events_url":"https://api.github.com/users/ffrank/received_events","type":"User","site_admin":false},"repo":{"id":50958700,"name":"mgmt","full_name":"ffrank/mgmt","owner":{"login":"ffrank","id":436765,"avatar_url":"https://avatars.githubusercontent.com/u/436765?v=3","gravatar_id":"","url":"https://api.github.com/users/ffrank","html_url":"https://github.com/ffrank","followers_url":"https://api.github.com/users/ffrank/followers","following_url":"https://api.github.com/users/ffrank/following{/other_user}","gists_url":"https://api.github.com/users/ffrank/gists{/gist_id}","starred_url":"https://api.github.com/users/ffrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffrank/subscriptions","organizations_url":"https://api.github.com/users/ffrank/orgs","repos_url":"https://api.github.com/users/ffrank/repos","events_url":"https://api.github.com/users/ffrank/events{/privacy}","received_events_url":"https://api.github.com/users/ffrank/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ffrank/mgmt","description":"A next generation config management prototype!","fork":true,"url":"https://api.github.com/repos/ffrank/mgmt","forks_url":"https://api.github.com/repos/ffrank/mgmt/forks","keys_url":"https://api.github.com/repos/ffrank/mgmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ffrank/mgmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ffrank/mgmt/teams","hooks_url":"https://api.github.com/repos/ffrank/mgmt/hooks","issue_events_url":"https://api.github.com/repos/ffrank/mgmt/issues/events{/number}","events_url":"https://api.github.com/repos/ffrank/mgmt/events","assignees_url":"https://api.github.com/repos/ffrank/mgmt/assignees{/user}","branches_url":"https://api.github.com/repos/ffrank/mgmt/branches{/branch}","tags_url":"https://api.github.com/repos/ffrank/mgmt/tags","blobs_url":"https://api.github.com/repos/ffrank/mgmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ffrank/mgmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ffrank/mgmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/ffrank/mgmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ffrank/mgmt/statuses/{sha}","languages_url":"https://api.github.com/repos/ffrank/mgmt/languages","stargazers_url":"https://api.github.com/repos/ffrank/mgmt/stargazers","contributors_url":"https://api.github.com/repos/ffrank/mgmt/contributors","subscribers_url":"https://api.github.com/repos/ffrank/mgmt/subscribers","subscription_url":"https://api.github.com/repos/ffrank/mgmt/subscription","commits_url":"https://api.github.com/repos/ffrank/mgmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/ffrank/mgmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/ffrank/mgmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/ffrank/mgmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/ffrank/mgmt/contents/{+path}","compare_url":"https://api.github.com/repos/ffrank/mgmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ffrank/mgmt/merges","archive_url":"https://api.github.com/repos/ffrank/mgmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ffrank/mgmt/downloads","issues_url":"https://api.github.com/repos/ffrank/mgmt/issues{/number}","pulls_url":"https://api.github.com/repos/ffrank/mgmt/pulls{/number}","milestones_url":"https://api.github.com/repos/ffrank/mgmt/milestones{/number}","notifications_url":"https://api.github.com/repos/ffrank/mgmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ffrank/mgmt/labels{/name}","releases_url":"https://api.github.com/repos/ffrank/mgmt/releases{/id}","deployments_url":"https://api.github.com/repos/ffrank/mgmt/deployments","created_at":"2016-02-02T23:11:35Z","updated_at":"2016-02-02T23:11:36Z","pushed_at":"2016-05-26T00:13:00Z","git_url":"git://github.com/ffrank/mgmt.git","ssh_url":"git@github.com:ffrank/mgmt.git","clone_url":"https://github.com/ffrank/mgmt.git","svn_url":"https://github.com/ffrank/mgmt","homepage":null,"size":409,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"purpleidea:master","ref":"master","sha":"05c540e6cce00d7a9993873f5c0528eb43ceebaf","user":{"login":"purpleidea","id":135091,"avatar_url":"https://avatars.githubusercontent.com/u/135091?v=3","gravatar_id":"","url":"https://api.github.com/users/purpleidea","html_url":"https://github.com/purpleidea","followers_url":"https://api.github.com/users/purpleidea/followers","following_url":"https://api.github.com/users/purpleidea/following{/other_user}","gists_url":"https://api.github.com/users/purpleidea/gists{/gist_id}","starred_url":"https://api.github.com/users/purpleidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purpleidea/subscriptions","organizations_url":"https://api.github.com/users/purpleidea/orgs","repos_url":"https://api.github.com/users/purpleidea/repos","events_url":"https://api.github.com/users/purpleidea/events{/privacy}","received_events_url":"https://api.github.com/users/purpleidea/received_events","type":"User","site_admin":false},"repo":{"id":43111018,"name":"mgmt","full_name":"purpleidea/mgmt","owner":{"login":"purpleidea","id":135091,"avatar_url":"https://avatars.githubusercontent.com/u/135091?v=3","gravatar_id":"","url":"https://api.github.com/users/purpleidea","html_url":"https://github.com/purpleidea","followers_url":"https://api.github.com/users/purpleidea/followers","following_url":"https://api.github.com/users/purpleidea/following{/other_user}","gists_url":"https://api.github.com/users/purpleidea/gists{/gist_id}","starred_url":"https://api.github.com/users/purpleidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purpleidea/subscriptions","organizations_url":"https://api.github.com/users/purpleidea/orgs","repos_url":"https://api.github.com/users/purpleidea/repos","events_url":"https://api.github.com/users/purpleidea/events{/privacy}","received_events_url":"https://api.github.com/users/purpleidea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/purpleidea/mgmt","description":"A next generation config management prototype!","fork":false,"url":"https://api.github.com/repos/purpleidea/mgmt","forks_url":"https://api.github.com/repos/purpleidea/mgmt/forks","keys_url":"https://api.github.com/repos/purpleidea/mgmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purpleidea/mgmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purpleidea/mgmt/teams","hooks_url":"https://api.github.com/repos/purpleidea/mgmt/hooks","issue_events_url":"https://api.github.com/repos/purpleidea/mgmt/issues/events{/number}","events_url":"https://api.github.com/repos/purpleidea/mgmt/events","assignees_url":"https://api.github.com/repos/purpleidea/mgmt/assignees{/user}","branches_url":"https://api.github.com/repos/purpleidea/mgmt/branches{/branch}","tags_url":"https://api.github.com/repos/purpleidea/mgmt/tags","blobs_url":"https://api.github.com/repos/purpleidea/mgmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purpleidea/mgmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purpleidea/mgmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/purpleidea/mgmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purpleidea/mgmt/statuses/{sha}","languages_url":"https://api.github.com/repos/purpleidea/mgmt/languages","stargazers_url":"https://api.github.com/repos/purpleidea/mgmt/stargazers","contributors_url":"https://api.github.com/repos/purpleidea/mgmt/contributors","subscribers_url":"https://api.github.com/repos/purpleidea/mgmt/subscribers","subscription_url":"https://api.github.com/repos/purpleidea/mgmt/subscription","commits_url":"https://api.github.com/repos/purpleidea/mgmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/purpleidea/mgmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/purpleidea/mgmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/purpleidea/mgmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/purpleidea/mgmt/contents/{+path}","compare_url":"https://api.github.com/repos/purpleidea/mgmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purpleidea/mgmt/merges","archive_url":"https://api.github.com/repos/purpleidea/mgmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purpleidea/mgmt/downloads","issues_url":"https://api.github.com/repos/purpleidea/mgmt/issues{/number}","pulls_url":"https://api.github.com/repos/purpleidea/mgmt/pulls{/number}","milestones_url":"https://api.github.com/repos/purpleidea/mgmt/milestones{/number}","notifications_url":"https://api.github.com/repos/purpleidea/mgmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purpleidea/mgmt/labels{/name}","releases_url":"https://api.github.com/repos/purpleidea/mgmt/releases{/id}","deployments_url":"https://api.github.com/repos/purpleidea/mgmt/deployments","created_at":"2015-09-25T05:15:41Z","updated_at":"2016-05-26T05:18:22Z","pushed_at":"2016-05-26T08:50:56Z","git_url":"git://github.com/purpleidea/mgmt.git","ssh_url":"git@github.com:purpleidea/mgmt.git","clone_url":"https://github.com/purpleidea/mgmt.git","svn_url":"https://github.com/purpleidea/mgmt","homepage":null,"size":390,"stargazers_count":401,"watchers_count":401,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":17,"forks":48,"open_issues":17,"watchers":401,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/47"},"html":{"href":"https://github.com/purpleidea/mgmt/pull/47"},"issue":{"href":"https://api.github.com/repos/purpleidea/mgmt/issues/47"},"comments":{"href":"https://api.github.com/repos/purpleidea/mgmt/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/purpleidea/mgmt/statuses/3ebaaf6a515f926113cf2fc820187a3f001d5233"}}}}
{"actor":{"display_login":"ffrank"}}