{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/comments/57716411","id":57716411,"diff_hunk":"@@ -52,9 +52,14 @@ def self.prefetch(resources)\n     return if entries.nil?\n     resources.each do |name, resource|\n       provider = entries.find { |entry| entry.name == name }\n-      if provider.nil? && resource[:ignore_missing]\n-        # just consider it has a value we exepcted\n-        provider = new(:name => name, :value => resource[:value])\n+      if provider.nil?\n+        # config_entry doesn't exist\n+        if resource[:ignore_missing]\n+          # just pretend it has the value we expect\n+          provider = new(:name => name, :value => resource[:value])\n+        else\n+          next\n+        end\n       end\n       resources[name].provider = provider","path":"lib/puppet/provider/foreman_config_entry/cli.rb","position":16,"original_position":16,"commit_id":"766d835102efeb1d348fcf96482300421bca7bd5","original_commit_id":"766d835102efeb1d348fcf96482300421bca7bd5","user":{"login":"domcleal","id":482089,"avatar_url":"https://avatars.githubusercontent.com/u/482089?v=3","gravatar_id":"","url":"https://api.github.com/users/domcleal","html_url":"https://github.com/domcleal","followers_url":"https://api.github.com/users/domcleal/followers","following_url":"https://api.github.com/users/domcleal/following{/other_user}","gists_url":"https://api.github.com/users/domcleal/gists{/gist_id}","starred_url":"https://api.github.com/users/domcleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domcleal/subscriptions","organizations_url":"https://api.github.com/users/domcleal/orgs","repos_url":"https://api.github.com/users/domcleal/repos","events_url":"https://api.github.com/users/domcleal/events{/privacy}","received_events_url":"https://api.github.com/users/domcleal/received_events","type":"User","site_admin":false},"body":"It'd be more typical to add `if provider` at the end here, rather than change the flow of the loop above with `next`.","created_at":"2016-03-29T12:45:29Z","updated_at":"2016-03-29T12:45:29Z","html_url":"https://github.com/theforeman/puppet-foreman/pull/420#discussion_r57716411","pull_request_url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420","_links":{"self":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/comments/57716411"},"html":{"href":"https://github.com/theforeman/puppet-foreman/pull/420#discussion_r57716411"},"pull_request":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420","id":64450653,"html_url":"https://github.com/theforeman/puppet-foreman/pull/420","diff_url":"https://github.com/theforeman/puppet-foreman/pull/420.diff","patch_url":"https://github.com/theforeman/puppet-foreman/pull/420.patch","issue_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/420","number":420,"state":"open","locked":false,"title":"Fix nil provider assignment in foreman_config_entry.","user":{"login":"tdevelioglu","id":2796632,"avatar_url":"https://avatars.githubusercontent.com/u/2796632?v=3","gravatar_id":"","url":"https://api.github.com/users/tdevelioglu","html_url":"https://github.com/tdevelioglu","followers_url":"https://api.github.com/users/tdevelioglu/followers","following_url":"https://api.github.com/users/tdevelioglu/following{/other_user}","gists_url":"https://api.github.com/users/tdevelioglu/gists{/gist_id}","starred_url":"https://api.github.com/users/tdevelioglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdevelioglu/subscriptions","organizations_url":"https://api.github.com/users/tdevelioglu/orgs","repos_url":"https://api.github.com/users/tdevelioglu/repos","events_url":"https://api.github.com/users/tdevelioglu/events{/privacy}","received_events_url":"https://api.github.com/users/tdevelioglu/received_events","type":"User","site_admin":false},"body":"Provider `cli` for `foreman_config_entry` can pass nil instead of a\r\nvalid provider during prefetch if a config_entry is not found.\r\n\r\nThis breaks puppet during prefetch:\r\n\r\n    Error: Could not prefetch foreman_config_entry provider 'cli': undefined\r\n    method `intern' for nil:NilClass\r\n    /opt/ruby2.0/lib/vendor_ruby/2.0.0/puppet/type.rb:1715:in `provider'\r\n    /opt/ruby2.0/lib/vendor_ruby/2.0.0/puppet/type.rb:1928:in `provider='\r\n    /var/lib/puppet/lib/puppet/provider/foreman_config_entry/cli.rb:59:in `block in prefetch'\r\n    /var/lib/puppet/lib/puppet/provider/foreman_config_entry/cli.rb:53:in `each'\r\n    /var/lib/puppet/lib/puppet/provider/foreman_config_entry/cli.rb:53:in `prefetch'\r\n    /opt/ruby2.0/lib/vendor_ruby/2.0.0/puppet/transaction.rb:307:in `prefetch'\r\n\r\nThis commit, correctly, skips provider assignment for config entries that\r\ndon't exist.\r\n","created_at":"2016-03-29T11:28:36Z","updated_at":"2016-03-29T12:45:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e75e78cd27123562a57777e893152caad8f94466","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420/commits","review_comments_url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420/comments","review_comment_url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/420/comments","statuses_url":"https://api.github.com/repos/theforeman/puppet-foreman/statuses/766d835102efeb1d348fcf96482300421bca7bd5","head":{"label":"tdevelioglu:dont_return_nil_provider","ref":"dont_return_nil_provider","sha":"766d835102efeb1d348fcf96482300421bca7bd5","user":{"login":"tdevelioglu","id":2796632,"avatar_url":"https://avatars.githubusercontent.com/u/2796632?v=3","gravatar_id":"","url":"https://api.github.com/users/tdevelioglu","html_url":"https://github.com/tdevelioglu","followers_url":"https://api.github.com/users/tdevelioglu/followers","following_url":"https://api.github.com/users/tdevelioglu/following{/other_user}","gists_url":"https://api.github.com/users/tdevelioglu/gists{/gist_id}","starred_url":"https://api.github.com/users/tdevelioglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdevelioglu/subscriptions","organizations_url":"https://api.github.com/users/tdevelioglu/orgs","repos_url":"https://api.github.com/users/tdevelioglu/repos","events_url":"https://api.github.com/users/tdevelioglu/events{/privacy}","received_events_url":"https://api.github.com/users/tdevelioglu/received_events","type":"User","site_admin":false},"repo":{"id":54968957,"name":"puppet-foreman","full_name":"tdevelioglu/puppet-foreman","owner":{"login":"tdevelioglu","id":2796632,"avatar_url":"https://avatars.githubusercontent.com/u/2796632?v=3","gravatar_id":"","url":"https://api.github.com/users/tdevelioglu","html_url":"https://github.com/tdevelioglu","followers_url":"https://api.github.com/users/tdevelioglu/followers","following_url":"https://api.github.com/users/tdevelioglu/following{/other_user}","gists_url":"https://api.github.com/users/tdevelioglu/gists{/gist_id}","starred_url":"https://api.github.com/users/tdevelioglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdevelioglu/subscriptions","organizations_url":"https://api.github.com/users/tdevelioglu/orgs","repos_url":"https://api.github.com/users/tdevelioglu/repos","events_url":"https://api.github.com/users/tdevelioglu/events{/privacy}","received_events_url":"https://api.github.com/users/tdevelioglu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tdevelioglu/puppet-foreman","description":"Puppet module for Foreman","fork":true,"url":"https://api.github.com/repos/tdevelioglu/puppet-foreman","forks_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/forks","keys_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/teams","hooks_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/hooks","issue_events_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/issues/events{/number}","events_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/events","assignees_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/assignees{/user}","branches_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/branches{/branch}","tags_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/tags","blobs_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/languages","stargazers_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/stargazers","contributors_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/contributors","subscribers_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/subscribers","subscription_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/subscription","commits_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/contents/{+path}","compare_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/merges","archive_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/downloads","issues_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/issues{/number}","pulls_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/labels{/name}","releases_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/releases{/id}","deployments_url":"https://api.github.com/repos/tdevelioglu/puppet-foreman/deployments","created_at":"2016-03-29T11:02:46Z","updated_at":"2016-03-29T11:02:47Z","pushed_at":"2016-03-29T11:23:42Z","git_url":"git://github.com/tdevelioglu/puppet-foreman.git","ssh_url":"git@github.com:tdevelioglu/puppet-foreman.git","clone_url":"https://github.com/tdevelioglu/puppet-foreman.git","svn_url":"https://github.com/tdevelioglu/puppet-foreman","homepage":"","size":720,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"theforeman:master","ref":"master","sha":"eb538ff27156daed81a7b02a195f9ebac7cc2e03","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":3449583,"name":"puppet-foreman","full_name":"theforeman/puppet-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/puppet-foreman","description":"Puppet module for Foreman","fork":false,"url":"https://api.github.com/repos/theforeman/puppet-foreman","forks_url":"https://api.github.com/repos/theforeman/puppet-foreman/forks","keys_url":"https://api.github.com/repos/theforeman/puppet-foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/puppet-foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/puppet-foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/puppet-foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/puppet-foreman/events","assignees_url":"https://api.github.com/repos/theforeman/puppet-foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/puppet-foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/puppet-foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/puppet-foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/puppet-foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/puppet-foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/puppet-foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/puppet-foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/puppet-foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/puppet-foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/puppet-foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/puppet-foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/puppet-foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/puppet-foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/puppet-foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/puppet-foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/puppet-foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/puppet-foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/puppet-foreman/merges","archive_url":"https://api.github.com/repos/theforeman/puppet-foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/puppet-foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/puppet-foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/puppet-foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/puppet-foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/puppet-foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/puppet-foreman/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/puppet-foreman/deployments","created_at":"2012-02-15T13:19:01Z","updated_at":"2016-01-30T14:19:55Z","pushed_at":"2016-03-29T12:24:12Z","git_url":"git://github.com/theforeman/puppet-foreman.git","ssh_url":"git@github.com:theforeman/puppet-foreman.git","clone_url":"https://github.com/theforeman/puppet-foreman.git","svn_url":"https://github.com/theforeman/puppet-foreman","homepage":"","size":1030,"stargazers_count":68,"watchers_count":68,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":161,"mirror_url":null,"open_issues_count":15,"forks":161,"open_issues":15,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420"},"html":{"href":"https://github.com/theforeman/puppet-foreman/pull/420"},"issue":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/issues/420"},"comments":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/issues/420/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/pulls/420/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/puppet-foreman/statuses/766d835102efeb1d348fcf96482300421bca7bd5"}}}}