{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/73505719","id":73505719,"diff_hunk":"@@ -0,0 +1,116 @@\n+module HostInfoProviders\n+  module PuppetInfo\n+    extend ActiveSupport::Concern\n+\n+    included do\n+      register_info_provider :puppet_info\n+    end\n+\n+    def puppet_info\n+      # Static parameters\n+      param = parameters_info_hash\n+\n+      # Parse ERB values contained in the parameters\n+      param = SafeRender.new(:variables => { :host => self }).parse(param)\n+\n+      info_hash = {}\n+      info_hash['classes'] = classes_info_hash\n+      info_hash['parameters'] = param\n+      info_hash['environment'] = param[\"foreman_env\"] if Setting[\"enc_environment\"] && param[\"foreman_env\"]","path":"app/models/concerns/host_info_providers/puppet_info.rb","position":19,"original_position":19,"commit_id":"6b9dcbc8a0daac68368d07fde350c57715e42a3c","original_commit_id":"6b9dcbc8a0daac68368d07fde350c57715e42a3c","user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","gravatar_id":"","url":"https://api.github.com/users/dLobatog","html_url":"https://github.com/dLobatog","followers_url":"https://api.github.com/users/dLobatog/followers","following_url":"https://api.github.com/users/dLobatog/following{/other_user}","gists_url":"https://api.github.com/users/dLobatog/gists{/gist_id}","starred_url":"https://api.github.com/users/dLobatog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dLobatog/subscriptions","organizations_url":"https://api.github.com/users/dLobatog/orgs","repos_url":"https://api.github.com/users/dLobatog/repos","events_url":"https://api.github.com/users/dLobatog/events{/privacy}","received_events_url":"https://api.github.com/users/dLobatog/received_events","type":"User","site_admin":false},"body":"`param[\"foreman_env\"].present?` instead would work better, `foreman_env' = ' ' right now returns true","created_at":"2016-08-04T11:32:37Z","updated_at":"2016-08-04T11:32:37Z","html_url":"https://github.com/theforeman/foreman/pull/3701#discussion_r73505719","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/3701","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/73505719"},"html":{"href":"https://github.com/theforeman/foreman/pull/3701#discussion_r73505719"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/3701"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/3701","id":79950604,"html_url":"https://github.com/theforeman/foreman/pull/3701","diff_url":"https://github.com/theforeman/foreman/pull/3701.diff","patch_url":"https://github.com/theforeman/foreman/pull/3701.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/3701","number":3701,"state":"open","locked":false,"title":"Fixes #15711 - Redesigned host info to providers.","user":{"login":"ShimShtein","id":10046168,"avatar_url":"https://avatars.githubusercontent.com/u/10046168?v=3","gravatar_id":"","url":"https://api.github.com/users/ShimShtein","html_url":"https://github.com/ShimShtein","followers_url":"https://api.github.com/users/ShimShtein/followers","following_url":"https://api.github.com/users/ShimShtein/following{/other_user}","gists_url":"https://api.github.com/users/ShimShtein/gists{/gist_id}","starred_url":"https://api.github.com/users/ShimShtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShimShtein/subscriptions","organizations_url":"https://api.github.com/users/ShimShtein/orgs","repos_url":"https://api.github.com/users/ShimShtein/repos","events_url":"https://api.github.com/users/ShimShtein/events{/privacy}","received_events_url":"https://api.github.com/users/ShimShtein/received_events","type":"User","site_admin":false},"body":"Now you can add your own info by registering a host method that will return info hash.\r\n\r\n#### Main files\r\n`app/models/concerns/host_info.rb`: Core concern, responsible for registration and querying of different info providers.\r\n`app/models/concerns/host_info_providers/static_info.rb`: Provider of the basic (and static) information, like hostgroup, interfaces e.t.c.\r\n`app/models/concerns/host_info_providers/puppet_info.rb`: Provider for the puppet specific information, like smart class parameters and smart variables.\r\n`app/models/concerns/host_params.rb`: Became a provider of (global) host parameters.\r\n\r\n#### Classification\r\nRemoved the hierarchy from `Classification` and left the base class as a service class that knows how to calculate values for a given set of keys (the type of keys does not matter).\r\nThe logic that was stored in the child classes moved to PuppetInfo concern.","created_at":"2016-08-03T17:58:42Z","updated_at":"2016-08-04T11:32:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d974c289be0db57a1f6156b2c3d27710ba52f41","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/3701/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/3701/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/3701/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/6b9dcbc8a0daac68368d07fde350c57715e42a3c","head":{"label":"ShimShtein:15711","ref":"15711","sha":"6b9dcbc8a0daac68368d07fde350c57715e42a3c","user":{"login":"ShimShtein","id":10046168,"avatar_url":"https://avatars.githubusercontent.com/u/10046168?v=3","gravatar_id":"","url":"https://api.github.com/users/ShimShtein","html_url":"https://github.com/ShimShtein","followers_url":"https://api.github.com/users/ShimShtein/followers","following_url":"https://api.github.com/users/ShimShtein/following{/other_user}","gists_url":"https://api.github.com/users/ShimShtein/gists{/gist_id}","starred_url":"https://api.github.com/users/ShimShtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShimShtein/subscriptions","organizations_url":"https://api.github.com/users/ShimShtein/orgs","repos_url":"https://api.github.com/users/ShimShtein/repos","events_url":"https://api.github.com/users/ShimShtein/events{/privacy}","received_events_url":"https://api.github.com/users/ShimShtein/received_events","type":"User","site_admin":false},"repo":{"id":27429897,"name":"foreman","full_name":"ShimShtein/foreman","owner":{"login":"ShimShtein","id":10046168,"avatar_url":"https://avatars.githubusercontent.com/u/10046168?v=3","gravatar_id":"","url":"https://api.github.com/users/ShimShtein","html_url":"https://github.com/ShimShtein","followers_url":"https://api.github.com/users/ShimShtein/followers","following_url":"https://api.github.com/users/ShimShtein/following{/other_user}","gists_url":"https://api.github.com/users/ShimShtein/gists{/gist_id}","starred_url":"https://api.github.com/users/ShimShtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShimShtein/subscriptions","organizations_url":"https://api.github.com/users/ShimShtein/orgs","repos_url":"https://api.github.com/users/ShimShtein/repos","events_url":"https://api.github.com/users/ShimShtein/events{/privacy}","received_events_url":"https://api.github.com/users/ShimShtein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShimShtein/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/ShimShtein/foreman","forks_url":"https://api.github.com/repos/ShimShtein/foreman/forks","keys_url":"https://api.github.com/repos/ShimShtein/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShimShtein/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShimShtein/foreman/teams","hooks_url":"https://api.github.com/repos/ShimShtein/foreman/hooks","issue_events_url":"https://api.github.com/repos/ShimShtein/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/ShimShtein/foreman/events","assignees_url":"https://api.github.com/repos/ShimShtein/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/ShimShtein/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/ShimShtein/foreman/tags","blobs_url":"https://api.github.com/repos/ShimShtein/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShimShtein/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShimShtein/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShimShtein/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShimShtein/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/ShimShtein/foreman/languages","stargazers_url":"https://api.github.com/repos/ShimShtein/foreman/stargazers","contributors_url":"https://api.github.com/repos/ShimShtein/foreman/contributors","subscribers_url":"https://api.github.com/repos/ShimShtein/foreman/subscribers","subscription_url":"https://api.github.com/repos/ShimShtein/foreman/subscription","commits_url":"https://api.github.com/repos/ShimShtein/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShimShtein/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShimShtein/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShimShtein/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShimShtein/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/ShimShtein/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShimShtein/foreman/merges","archive_url":"https://api.github.com/repos/ShimShtein/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShimShtein/foreman/downloads","issues_url":"https://api.github.com/repos/ShimShtein/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/ShimShtein/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/ShimShtein/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/ShimShtein/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShimShtein/foreman/labels{/name}","releases_url":"https://api.github.com/repos/ShimShtein/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/ShimShtein/foreman/deployments","created_at":"2014-12-02T11:40:34Z","updated_at":"2015-04-22T09:01:47Z","pushed_at":"2016-08-03T18:24:48Z","git_url":"git://github.com/ShimShtein/foreman.git","ssh_url":"git@github.com:ShimShtein/foreman.git","clone_url":"https://github.com/ShimShtein/foreman.git","svn_url":"https://github.com/ShimShtein/foreman","homepage":"http://theforeman.org","size":39496,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"46597839accd8533db119d56135a9b6ed9e01f87","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":258750,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/foreman/deployments","created_at":"2009-07-23T15:07:00Z","updated_at":"2016-08-03T13:47:57Z","pushed_at":"2016-08-04T10:42:08Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":68799,"stargazers_count":1064,"watchers_count":1064,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":536,"mirror_url":null,"open_issues_count":79,"forks":536,"open_issues":79,"watchers":1064,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/3701"},"html":{"href":"https://github.com/theforeman/foreman/pull/3701"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/3701"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/3701/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/3701/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/3701/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/6b9dcbc8a0daac68368d07fde350c57715e42a3c"}}}}
{"actor":{"display_login":"dLobatog"}}