{"action":"created","comment":{"url":"https://api.github.com/repos/Katello/katello/pulls/comments/50937006","id":50937006,"diff_hunk":"@@ -67,6 +67,22 @@ def import_package_profile(simple_packages)\n           self.installed_packages.create!(:name => simple_package.name, :nvra => simple_package.nvra) unless existing_nvras.include?(simple_package.nvra)\n         end\n       end\n+\n+      def subscription_status(options = {})\n+        @subscription_status ||= get_status(::Katello::SubscriptionStatus).to_status(options)\n+      end\n+\n+      def subscription_status_label(options = {})\n+        @subscription_status_label ||= get_status(::Katello::SubscriptionStatus).to_label(options)\n+      end\n+\n+      def errata_status(options = {})\n+        @errata_status ||= get_status(::Katello::ErrataStatus).to_status(options)\n+      end\n+\n+      def errata_status_label(options = {})\n+        @errata_status_label ||= get_status(::Katello::ErrataStatus).to_label(options)\n+      end","path":"app/models/katello/concerns/host_managed_extensions.rb","position":19,"original_position":19,"commit_id":"b14a6b8736e11e75aa2b6c2d7be80be935cf648a","original_commit_id":"b14a6b8736e11e75aa2b6c2d7be80be935cf648a","user":{"login":"jlsherrill","id":395077,"avatar_url":"https://avatars.githubusercontent.com/u/395077?v=3","gravatar_id":"","url":"https://api.github.com/users/jlsherrill","html_url":"https://github.com/jlsherrill","followers_url":"https://api.github.com/users/jlsherrill/followers","following_url":"https://api.github.com/users/jlsherrill/following{/other_user}","gists_url":"https://api.github.com/users/jlsherrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jlsherrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlsherrill/subscriptions","organizations_url":"https://api.github.com/users/jlsherrill/orgs","repos_url":"https://api.github.com/users/jlsherrill/repos","events_url":"https://api.github.com/users/jlsherrill/events{/privacy}","received_events_url":"https://api.github.com/users/jlsherrill/received_events","type":"User","site_admin":false},"body":"@ehelms so actually i didn't realize that foreman was already returning the statuses and labels if these methods exist:\r\n\r\n```\r\n\"global_status\": 0,\r\n\"global_status_label\": \"Warning\",\r\n\"organization_id\": 1,\r\n\"organization_name\": \"Default Organization\",\r\n\"location_id\": 2,\r\n\"location_name\": \"Default Location\",\r\n\"puppet_status\": 0,\r\n\"errata_status\": 1,\r\n\"errata_status_label\": \"Could not calculate errata status, ensure host is registered and katello-agent is installed\",\r\n\"subscription_status\": 0,\r\n\"subscription_status_label\": \"Fully entitled\",\r\n```\r\n\r\nSo i agree that this isn't ideal, but its what foreman is doing right now.  I could remove these methods and redefine it our own way, or go with this.  Thoughts?","created_at":"2016-01-27T03:20:07Z","updated_at":"2016-01-27T03:20:07Z","html_url":"https://github.com/Katello/katello/pull/5724#discussion_r50937006","pull_request_url":"https://api.github.com/repos/Katello/katello/pulls/5724","_links":{"self":{"href":"https://api.github.com/repos/Katello/katello/pulls/comments/50937006"},"html":{"href":"https://github.com/Katello/katello/pull/5724#discussion_r50937006"},"pull_request":{"href":"https://api.github.com/repos/Katello/katello/pulls/5724"}}},"pull_request":{"url":"https://api.github.com/repos/Katello/katello/pulls/5724","id":56938140,"html_url":"https://github.com/Katello/katello/pull/5724","diff_url":"https://github.com/Katello/katello/pull/5724.diff","patch_url":"https://github.com/Katello/katello/pull/5724.patch","issue_url":"https://api.github.com/repos/Katello/katello/issues/5724","number":5724,"state":"open","locked":false,"title":"Fixes #13338 - adding facet attributes for host api","user":{"login":"jlsherrill","id":395077,"avatar_url":"https://avatars.githubusercontent.com/u/395077?v=3","gravatar_id":"","url":"https://api.github.com/users/jlsherrill","html_url":"https://github.com/jlsherrill","followers_url":"https://api.github.com/users/jlsherrill/followers","following_url":"https://api.github.com/users/jlsherrill/following{/other_user}","gists_url":"https://api.github.com/users/jlsherrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jlsherrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlsherrill/subscriptions","organizations_url":"https://api.github.com/users/jlsherrill/orgs","repos_url":"https://api.github.com/users/jlsherrill/repos","events_url":"https://api.github.com/users/jlsherrill/events{/privacy}","received_events_url":"https://api.github.com/users/jlsherrill/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-22T20:34:14Z","updated_at":"2016-01-27T03:20:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44c931442203036c48b7bee256dc31cc90c6abea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Katello/katello/pulls/5724/commits","review_comments_url":"https://api.github.com/repos/Katello/katello/pulls/5724/comments","review_comment_url":"https://api.github.com/repos/Katello/katello/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Katello/katello/issues/5724/comments","statuses_url":"https://api.github.com/repos/Katello/katello/statuses/b14a6b8736e11e75aa2b6c2d7be80be935cf648a","head":{"label":"jlsherrill:facet_api","ref":"facet_api","sha":"b14a6b8736e11e75aa2b6c2d7be80be935cf648a","user":{"login":"jlsherrill","id":395077,"avatar_url":"https://avatars.githubusercontent.com/u/395077?v=3","gravatar_id":"","url":"https://api.github.com/users/jlsherrill","html_url":"https://github.com/jlsherrill","followers_url":"https://api.github.com/users/jlsherrill/followers","following_url":"https://api.github.com/users/jlsherrill/following{/other_user}","gists_url":"https://api.github.com/users/jlsherrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jlsherrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlsherrill/subscriptions","organizations_url":"https://api.github.com/users/jlsherrill/orgs","repos_url":"https://api.github.com/users/jlsherrill/repos","events_url":"https://api.github.com/users/jlsherrill/events{/privacy}","received_events_url":"https://api.github.com/users/jlsherrill/received_events","type":"User","site_admin":false},"repo":{"id":4041376,"name":"katello","full_name":"jlsherrill/katello","owner":{"login":"jlsherrill","id":395077,"avatar_url":"https://avatars.githubusercontent.com/u/395077?v=3","gravatar_id":"","url":"https://api.github.com/users/jlsherrill","html_url":"https://github.com/jlsherrill","followers_url":"https://api.github.com/users/jlsherrill/followers","following_url":"https://api.github.com/users/jlsherrill/following{/other_user}","gists_url":"https://api.github.com/users/jlsherrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jlsherrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlsherrill/subscriptions","organizations_url":"https://api.github.com/users/jlsherrill/orgs","repos_url":"https://api.github.com/users/jlsherrill/repos","events_url":"https://api.github.com/users/jlsherrill/events{/privacy}","received_events_url":"https://api.github.com/users/jlsherrill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlsherrill/katello","description":"Katello integrates open source systems management tools into a single solution for controlling the lifecycle of your machines.","fork":true,"url":"https://api.github.com/repos/jlsherrill/katello","forks_url":"https://api.github.com/repos/jlsherrill/katello/forks","keys_url":"https://api.github.com/repos/jlsherrill/katello/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlsherrill/katello/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlsherrill/katello/teams","hooks_url":"https://api.github.com/repos/jlsherrill/katello/hooks","issue_events_url":"https://api.github.com/repos/jlsherrill/katello/issues/events{/number}","events_url":"https://api.github.com/repos/jlsherrill/katello/events","assignees_url":"https://api.github.com/repos/jlsherrill/katello/assignees{/user}","branches_url":"https://api.github.com/repos/jlsherrill/katello/branches{/branch}","tags_url":"https://api.github.com/repos/jlsherrill/katello/tags","blobs_url":"https://api.github.com/repos/jlsherrill/katello/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlsherrill/katello/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlsherrill/katello/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlsherrill/katello/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlsherrill/katello/statuses/{sha}","languages_url":"https://api.github.com/repos/jlsherrill/katello/languages","stargazers_url":"https://api.github.com/repos/jlsherrill/katello/stargazers","contributors_url":"https://api.github.com/repos/jlsherrill/katello/contributors","subscribers_url":"https://api.github.com/repos/jlsherrill/katello/subscribers","subscription_url":"https://api.github.com/repos/jlsherrill/katello/subscription","commits_url":"https://api.github.com/repos/jlsherrill/katello/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlsherrill/katello/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlsherrill/katello/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlsherrill/katello/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlsherrill/katello/contents/{+path}","compare_url":"https://api.github.com/repos/jlsherrill/katello/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlsherrill/katello/merges","archive_url":"https://api.github.com/repos/jlsherrill/katello/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlsherrill/katello/downloads","issues_url":"https://api.github.com/repos/jlsherrill/katello/issues{/number}","pulls_url":"https://api.github.com/repos/jlsherrill/katello/pulls{/number}","milestones_url":"https://api.github.com/repos/jlsherrill/katello/milestones{/number}","notifications_url":"https://api.github.com/repos/jlsherrill/katello/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlsherrill/katello/labels{/name}","releases_url":"https://api.github.com/repos/jlsherrill/katello/releases{/id}","deployments_url":"https://api.github.com/repos/jlsherrill/katello/deployments","created_at":"2012-04-16T14:06:55Z","updated_at":"2014-07-31T00:15:04Z","pushed_at":"2016-01-27T03:17:55Z","git_url":"git://github.com/jlsherrill/katello.git","ssh_url":"git@github.com:jlsherrill/katello.git","clone_url":"https://github.com/jlsherrill/katello.git","svn_url":"https://github.com/jlsherrill/katello","homepage":"katello.org","size":76739,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"Katello:master","ref":"master","sha":"34f720d54f7e347743dfc8fdaf6aedd264320baa","user":{"login":"Katello","id":1316386,"avatar_url":"https://avatars.githubusercontent.com/u/1316386?v=3","gravatar_id":"","url":"https://api.github.com/users/Katello","html_url":"https://github.com/Katello","followers_url":"https://api.github.com/users/Katello/followers","following_url":"https://api.github.com/users/Katello/following{/other_user}","gists_url":"https://api.github.com/users/Katello/gists{/gist_id}","starred_url":"https://api.github.com/users/Katello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katello/subscriptions","organizations_url":"https://api.github.com/users/Katello/orgs","repos_url":"https://api.github.com/users/Katello/repos","events_url":"https://api.github.com/users/Katello/events{/privacy}","received_events_url":"https://api.github.com/users/Katello/received_events","type":"Organization","site_admin":false},"repo":{"id":4007018,"name":"katello","full_name":"Katello/katello","owner":{"login":"Katello","id":1316386,"avatar_url":"https://avatars.githubusercontent.com/u/1316386?v=3","gravatar_id":"","url":"https://api.github.com/users/Katello","html_url":"https://github.com/Katello","followers_url":"https://api.github.com/users/Katello/followers","following_url":"https://api.github.com/users/Katello/following{/other_user}","gists_url":"https://api.github.com/users/Katello/gists{/gist_id}","starred_url":"https://api.github.com/users/Katello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Katello/subscriptions","organizations_url":"https://api.github.com/users/Katello/orgs","repos_url":"https://api.github.com/users/Katello/repos","events_url":"https://api.github.com/users/Katello/events{/privacy}","received_events_url":"https://api.github.com/users/Katello/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Katello/katello","description":"Katello integrates open source systems management tools into a single solution for controlling the lifecycle of your machines.","fork":false,"url":"https://api.github.com/repos/Katello/katello","forks_url":"https://api.github.com/repos/Katello/katello/forks","keys_url":"https://api.github.com/repos/Katello/katello/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Katello/katello/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Katello/katello/teams","hooks_url":"https://api.github.com/repos/Katello/katello/hooks","issue_events_url":"https://api.github.com/repos/Katello/katello/issues/events{/number}","events_url":"https://api.github.com/repos/Katello/katello/events","assignees_url":"https://api.github.com/repos/Katello/katello/assignees{/user}","branches_url":"https://api.github.com/repos/Katello/katello/branches{/branch}","tags_url":"https://api.github.com/repos/Katello/katello/tags","blobs_url":"https://api.github.com/repos/Katello/katello/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Katello/katello/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Katello/katello/git/refs{/sha}","trees_url":"https://api.github.com/repos/Katello/katello/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Katello/katello/statuses/{sha}","languages_url":"https://api.github.com/repos/Katello/katello/languages","stargazers_url":"https://api.github.com/repos/Katello/katello/stargazers","contributors_url":"https://api.github.com/repos/Katello/katello/contributors","subscribers_url":"https://api.github.com/repos/Katello/katello/subscribers","subscription_url":"https://api.github.com/repos/Katello/katello/subscription","commits_url":"https://api.github.com/repos/Katello/katello/commits{/sha}","git_commits_url":"https://api.github.com/repos/Katello/katello/git/commits{/sha}","comments_url":"https://api.github.com/repos/Katello/katello/comments{/number}","issue_comment_url":"https://api.github.com/repos/Katello/katello/issues/comments{/number}","contents_url":"https://api.github.com/repos/Katello/katello/contents/{+path}","compare_url":"https://api.github.com/repos/Katello/katello/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Katello/katello/merges","archive_url":"https://api.github.com/repos/Katello/katello/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Katello/katello/downloads","issues_url":"https://api.github.com/repos/Katello/katello/issues{/number}","pulls_url":"https://api.github.com/repos/Katello/katello/pulls{/number}","milestones_url":"https://api.github.com/repos/Katello/katello/milestones{/number}","notifications_url":"https://api.github.com/repos/Katello/katello/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Katello/katello/labels{/name}","releases_url":"https://api.github.com/repos/Katello/katello/releases{/id}","deployments_url":"https://api.github.com/repos/Katello/katello/deployments","created_at":"2012-04-12T16:59:08Z","updated_at":"2016-01-14T05:15:22Z","pushed_at":"2016-01-27T03:17:55Z","git_url":"git://github.com/Katello/katello.git","ssh_url":"git@github.com:Katello/katello.git","clone_url":"https://github.com/Katello/katello.git","svn_url":"https://github.com/Katello/katello","homepage":"katello.org","size":91904,"stargazers_count":170,"watchers_count":170,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":120,"mirror_url":null,"open_issues_count":97,"forks":120,"open_issues":97,"watchers":170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Katello/katello/pulls/5724"},"html":{"href":"https://github.com/Katello/katello/pull/5724"},"issue":{"href":"https://api.github.com/repos/Katello/katello/issues/5724"},"comments":{"href":"https://api.github.com/repos/Katello/katello/issues/5724/comments"},"review_comments":{"href":"https://api.github.com/repos/Katello/katello/pulls/5724/comments"},"review_comment":{"href":"https://api.github.com/repos/Katello/katello/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Katello/katello/pulls/5724/commits"},"statuses":{"href":"https://api.github.com/repos/Katello/katello/statuses/b14a6b8736e11e75aa2b6c2d7be80be935cf648a"}}}}