{"action":"created","comment":{"url":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments/169980203","pull_request_review_id":98590717,"id":169980203,"diff_hunk":"@@ -0,0 +1,43 @@\n+// Mgmt\n+// Copyright (C) 2013-2018+ James Shubin and the project contributors\n+// Written by James Shubin <james@shubin.ca> and the project contributors\n+//\n+// This program is free software: you can redistribute it and/or modify\n+// it under the terms of the GNU General Public License as published by\n+// the Free Software Foundation, either version 3 of the License, or\n+// (at your option) any later version.\n+//\n+// This program is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+// GNU General Public License for more details.\n+//\n+// You should have received a copy of the GNU General Public License\n+// along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+\n+// a function to look up variables in the mgmt server instance environment\n+\n+package simple // TODO: should this be in its own individual package?\n+\n+import (\n+\t\"fmt\"\n+\t\"os\"\n+\n+\t\"github.com/purpleidea/mgmt/lang/types\"\n+)\n+\n+func init() {\n+\tRegister(\"getenv\", &types.FuncValue{\n+\t\tT: types.NewType(\"func(str, str) str\"),\n+\t\tV: func(input []types.Value) (types.Value, error) {\n+\t\t\tvalue := os.Getenv(input[0].Str())\n+\t\t\t// TODO: should empty/non-existing behaviour be different? ie: empty returns empty value?","path":"lang/funcs/simple/getenv_func.go","position":34,"original_position":34,"commit_id":"d0d9bb73170b2f76abe7227a473f0520f92b45b8","original_commit_id":"c70567cb90b96b962f6b11c01f215bcfdbdaf554","user":{"login":"aequitas","id":365827,"avatar_url":"https://avatars2.githubusercontent.com/u/365827?v=4","gravatar_id":"","url":"https://api.github.com/users/aequitas","html_url":"https://github.com/aequitas","followers_url":"https://api.github.com/users/aequitas/followers","following_url":"https://api.github.com/users/aequitas/following{/other_user}","gists_url":"https://api.github.com/users/aequitas/gists{/gist_id}","starred_url":"https://api.github.com/users/aequitas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aequitas/subscriptions","organizations_url":"https://api.github.com/users/aequitas/orgs","repos_url":"https://api.github.com/users/aequitas/repos","events_url":"https://api.github.com/users/aequitas/events{/privacy}","received_events_url":"https://api.github.com/users/aequitas/received_events","type":"User","site_admin":false},"body":"Input on this would be welcome.","created_at":"2018-02-22T14:48:32Z","updated_at":"2018-02-22T14:48:32Z","html_url":"https://github.com/purpleidea/mgmt/pull/352#discussion_r169980203","pull_request_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/352","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments/169980203"},"html":{"href":"https://github.com/purpleidea/mgmt/pull/352#discussion_r169980203"},"pull_request":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/352"}}},"pull_request":{"url":"https://api.github.com/repos/purpleidea/mgmt/pulls/352","id":170749383,"html_url":"https://github.com/purpleidea/mgmt/pull/352","diff_url":"https://github.com/purpleidea/mgmt/pull/352.diff","patch_url":"https://github.com/purpleidea/mgmt/pull/352.patch","issue_url":"https://api.github.com/repos/purpleidea/mgmt/issues/352","number":352,"state":"open","locked":false,"title":"lang: Add `getenv` function, fix .editorconfig for mcl files, tool links","user":{"login":"aequitas","id":365827,"avatar_url":"https://avatars2.githubusercontent.com/u/365827?v=4","gravatar_id":"","url":"https://api.github.com/users/aequitas","html_url":"https://github.com/aequitas","followers_url":"https://api.github.com/users/aequitas/followers","following_url":"https://api.github.com/users/aequitas/following{/other_user}","gists_url":"https://api.github.com/users/aequitas/gists{/gist_id}","starred_url":"https://api.github.com/users/aequitas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aequitas/subscriptions","organizations_url":"https://api.github.com/users/aequitas/orgs","repos_url":"https://api.github.com/users/aequitas/repos","events_url":"https://api.github.com/users/aequitas/events{/privacy}","received_events_url":"https://api.github.com/users/aequitas/received_events","type":"User","site_admin":false},"body":"title says it all","created_at":"2018-02-22T13:26:31Z","updated_at":"2018-02-22T14:48:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5d89bb42fdaf307bade67711be849c2a58d6589","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/352/commits","review_comments_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/352/comments","review_comment_url":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/purpleidea/mgmt/issues/352/comments","statuses_url":"https://api.github.com/repos/purpleidea/mgmt/statuses/d0d9bb73170b2f76abe7227a473f0520f92b45b8","head":{"label":"aequitas:getenv","ref":"getenv","sha":"d0d9bb73170b2f76abe7227a473f0520f92b45b8","user":{"login":"aequitas","id":365827,"avatar_url":"https://avatars2.githubusercontent.com/u/365827?v=4","gravatar_id":"","url":"https://api.github.com/users/aequitas","html_url":"https://github.com/aequitas","followers_url":"https://api.github.com/users/aequitas/followers","following_url":"https://api.github.com/users/aequitas/following{/other_user}","gists_url":"https://api.github.com/users/aequitas/gists{/gist_id}","starred_url":"https://api.github.com/users/aequitas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aequitas/subscriptions","organizations_url":"https://api.github.com/users/aequitas/orgs","repos_url":"https://api.github.com/users/aequitas/repos","events_url":"https://api.github.com/users/aequitas/events{/privacy}","received_events_url":"https://api.github.com/users/aequitas/received_events","type":"User","site_admin":false},"repo":{"id":120636701,"name":"mgmt","full_name":"aequitas/mgmt","owner":{"login":"aequitas","id":365827,"avatar_url":"https://avatars2.githubusercontent.com/u/365827?v=4","gravatar_id":"","url":"https://api.github.com/users/aequitas","html_url":"https://github.com/aequitas","followers_url":"https://api.github.com/users/aequitas/followers","following_url":"https://api.github.com/users/aequitas/following{/other_user}","gists_url":"https://api.github.com/users/aequitas/gists{/gist_id}","starred_url":"https://api.github.com/users/aequitas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aequitas/subscriptions","organizations_url":"https://api.github.com/users/aequitas/orgs","repos_url":"https://api.github.com/users/aequitas/repos","events_url":"https://api.github.com/users/aequitas/events{/privacy}","received_events_url":"https://api.github.com/users/aequitas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aequitas/mgmt","description":"Next generation distributed, event-driven, parallel config management!","fork":true,"url":"https://api.github.com/repos/aequitas/mgmt","forks_url":"https://api.github.com/repos/aequitas/mgmt/forks","keys_url":"https://api.github.com/repos/aequitas/mgmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aequitas/mgmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aequitas/mgmt/teams","hooks_url":"https://api.github.com/repos/aequitas/mgmt/hooks","issue_events_url":"https://api.github.com/repos/aequitas/mgmt/issues/events{/number}","events_url":"https://api.github.com/repos/aequitas/mgmt/events","assignees_url":"https://api.github.com/repos/aequitas/mgmt/assignees{/user}","branches_url":"https://api.github.com/repos/aequitas/mgmt/branches{/branch}","tags_url":"https://api.github.com/repos/aequitas/mgmt/tags","blobs_url":"https://api.github.com/repos/aequitas/mgmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aequitas/mgmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aequitas/mgmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/aequitas/mgmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aequitas/mgmt/statuses/{sha}","languages_url":"https://api.github.com/repos/aequitas/mgmt/languages","stargazers_url":"https://api.github.com/repos/aequitas/mgmt/stargazers","contributors_url":"https://api.github.com/repos/aequitas/mgmt/contributors","subscribers_url":"https://api.github.com/repos/aequitas/mgmt/subscribers","subscription_url":"https://api.github.com/repos/aequitas/mgmt/subscription","commits_url":"https://api.github.com/repos/aequitas/mgmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/aequitas/mgmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/aequitas/mgmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/aequitas/mgmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/aequitas/mgmt/contents/{+path}","compare_url":"https://api.github.com/repos/aequitas/mgmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aequitas/mgmt/merges","archive_url":"https://api.github.com/repos/aequitas/mgmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aequitas/mgmt/downloads","issues_url":"https://api.github.com/repos/aequitas/mgmt/issues{/number}","pulls_url":"https://api.github.com/repos/aequitas/mgmt/pulls{/number}","milestones_url":"https://api.github.com/repos/aequitas/mgmt/milestones{/number}","notifications_url":"https://api.github.com/repos/aequitas/mgmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aequitas/mgmt/labels{/name}","releases_url":"https://api.github.com/repos/aequitas/mgmt/releases{/id}","deployments_url":"https://api.github.com/repos/aequitas/mgmt/deployments","created_at":"2018-02-07T15:57:21Z","updated_at":"2018-02-07T15:57:23Z","pushed_at":"2018-02-22T14:47:46Z","git_url":"git://github.com/aequitas/mgmt.git","ssh_url":"git@github.com:aequitas/mgmt.git","clone_url":"https://github.com/aequitas/mgmt.git","svn_url":"https://github.com/aequitas/mgmt","homepage":"https://purpleidea.com/tags/mgmtconfig/","size":2649,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"purpleidea:master","ref":"master","sha":"9992c367bf007a8a3d74baa91cd5014cb031ba4d","user":{"login":"purpleidea","id":135091,"avatar_url":"https://avatars0.githubusercontent.com/u/135091?v=4","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://avatars0.githubusercontent.com/u/135091?v=4","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":"Next generation distributed, event-driven, parallel config management!","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":"2018-02-21T20:43:03Z","pushed_at":"2018-02-22T14:47:47Z","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":"https://purpleidea.com/tags/mgmtconfig/","size":2390,"stargazers_count":1174,"watchers_count":1174,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":154,"mirror_url":null,"archived":false,"open_issues_count":74,"license":null,"forks":154,"open_issues":74,"watchers":1174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/352"},"html":{"href":"https://github.com/purpleidea/mgmt/pull/352"},"issue":{"href":"https://api.github.com/repos/purpleidea/mgmt/issues/352"},"comments":{"href":"https://api.github.com/repos/purpleidea/mgmt/issues/352/comments"},"review_comments":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/352/comments"},"review_comment":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/purpleidea/mgmt/pulls/352/commits"},"statuses":{"href":"https://api.github.com/repos/purpleidea/mgmt/statuses/d0d9bb73170b2f76abe7227a473f0520f92b45b8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aequitas"}}