{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/83164228","pull_request_review_id":4022727,"id":83164228,"diff_hunk":"@@ -2,7 +2,19 @@ class ApplicationHelper::Button::HostFeatureButton < ApplicationHelper::Button::\n   needs :@record\n \n   def visible?\n-    return false if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager)\n+    if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager)\n+      return true if ['start', 'stop'].include?(@feature.to_s)\n+      return false\n+    end\n+\n+    if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager::Host)\n+      case @feature.to_s\n+        when 'start'\n+          return @record.validate_start[:available]","path":"app/helpers/application_helper/button/host_feature_button.rb","position":13,"original_position":13,"commit_id":"da5cddef6509e5d54457ca2dd7885f088ca84265","original_commit_id":"da5cddef6509e5d54457ca2dd7885f088ca84265","user":{"login":"romanblanco","id":1187051,"avatar_url":"https://avatars.githubusercontent.com/u/1187051?v=3","gravatar_id":"","url":"https://api.github.com/users/romanblanco","html_url":"https://github.com/romanblanco","followers_url":"https://api.github.com/users/romanblanco/followers","following_url":"https://api.github.com/users/romanblanco/following{/other_user}","gists_url":"https://api.github.com/users/romanblanco/gists{/gist_id}","starred_url":"https://api.github.com/users/romanblanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanblanco/subscriptions","organizations_url":"https://api.github.com/users/romanblanco/orgs","repos_url":"https://api.github.com/users/romanblanco/repos","events_url":"https://api.github.com/users/romanblanco/events{/privacy}","received_events_url":"https://api.github.com/users/romanblanco/received_events","type":"User","site_admin":false},"body":"@rwsu You don't need to call the validate methods this way, that's what [`AvailabilityMixin`](https://github.com/rwsu/manageiq/blob/da5cddef6509e5d54457ca2dd7885f088ca84265/app/models/mixins/availability_mixin.rb#L23-L24) was for. So using \r\n```ruby\r\n@record.is_available?(:start)\r\n```\r\nwas the correct way, if you'd want to use `AvailabilityMixin`, but the thing is, **we [don't want to use `AvailabilityMixin`](https://github.com/rwsu/manageiq/blob/da5cddef6509e5d54457ca2dd7885f088ca84265/app/models/mixins/availability_mixin.rb#L4) anymore**.\r\n\r\nSo you **should not** use validate methods in here:\r\n- `app/models/manageiq/providers/openstack/infra_manager.rb`\r\n- `app/models/manageiq/providers/openstack/infra_manager/host.rb`\r\n\r\nYou **should** use the new `SupportsFeatureMixin` for this *(usage is nicely documented [here](https://github.com/rwsu/manageiq/blob/da5cddef6509e5d54457ca2dd7885f088ca84265/app/models/mixins/supports_feature_mixin.rb#L3-L57))* :wink: ","created_at":"2016-10-13T08:20:35Z","updated_at":"2016-10-13T08:26:18Z","html_url":"https://github.com/ManageIQ/manageiq/pull/11634#discussion_r83164228","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/83164228"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/11634#discussion_r83164228"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634","id":87586626,"html_url":"https://github.com/ManageIQ/manageiq/pull/11634","diff_url":"https://github.com/ManageIQ/manageiq/pull/11634.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/11634.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/11634","number":11634,"state":"open","locked":false,"title":"OpenStack Infra: Enable node start and stop","user":{"login":"rwsu","id":974403,"avatar_url":"https://avatars.githubusercontent.com/u/974403?v=3","gravatar_id":"","url":"https://api.github.com/users/rwsu","html_url":"https://github.com/rwsu","followers_url":"https://api.github.com/users/rwsu/followers","following_url":"https://api.github.com/users/rwsu/following{/other_user}","gists_url":"https://api.github.com/users/rwsu/gists{/gist_id}","starred_url":"https://api.github.com/users/rwsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwsu/subscriptions","organizations_url":"https://api.github.com/users/rwsu/orgs","repos_url":"https://api.github.com/users/rwsu/repos","events_url":"https://api.github.com/users/rwsu/events{/privacy}","received_events_url":"https://api.github.com/users/rwsu/received_events","type":"User","site_admin":false},"body":"Enables starting and stopping nodes through the Ironic API.\r\n\r\nPreviously, all node operations were disabled for OpenStack. For\r\nnow, we are enabling only start and stop.","created_at":"2016-10-01T01:14:09Z","updated_at":"2016-10-13T08:26:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"747e599cb7c632de3d779e4bdd032ecb97f28614","assignee":{"login":"Ladas","id":1737058,"avatar_url":"https://avatars.githubusercontent.com/u/1737058?v=3","gravatar_id":"","url":"https://api.github.com/users/Ladas","html_url":"https://github.com/Ladas","followers_url":"https://api.github.com/users/Ladas/followers","following_url":"https://api.github.com/users/Ladas/following{/other_user}","gists_url":"https://api.github.com/users/Ladas/gists{/gist_id}","starred_url":"https://api.github.com/users/Ladas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ladas/subscriptions","organizations_url":"https://api.github.com/users/Ladas/orgs","repos_url":"https://api.github.com/users/Ladas/repos","events_url":"https://api.github.com/users/Ladas/events{/privacy}","received_events_url":"https://api.github.com/users/Ladas/received_events","type":"User","site_admin":false},"assignees":[{"login":"Ladas","id":1737058,"avatar_url":"https://avatars.githubusercontent.com/u/1737058?v=3","gravatar_id":"","url":"https://api.github.com/users/Ladas","html_url":"https://github.com/Ladas","followers_url":"https://api.github.com/users/Ladas/followers","following_url":"https://api.github.com/users/Ladas/following{/other_user}","gists_url":"https://api.github.com/users/Ladas/gists{/gist_id}","starred_url":"https://api.github.com/users/Ladas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ladas/subscriptions","organizations_url":"https://api.github.com/users/Ladas/orgs","repos_url":"https://api.github.com/users/Ladas/repos","events_url":"https://api.github.com/users/Ladas/events{/privacy}","received_events_url":"https://api.github.com/users/Ladas/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/11634/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/da5cddef6509e5d54457ca2dd7885f088ca84265","head":{"label":"rwsu:openstack_node_start_stop","ref":"openstack_node_start_stop","sha":"da5cddef6509e5d54457ca2dd7885f088ca84265","user":{"login":"rwsu","id":974403,"avatar_url":"https://avatars.githubusercontent.com/u/974403?v=3","gravatar_id":"","url":"https://api.github.com/users/rwsu","html_url":"https://github.com/rwsu","followers_url":"https://api.github.com/users/rwsu/followers","following_url":"https://api.github.com/users/rwsu/following{/other_user}","gists_url":"https://api.github.com/users/rwsu/gists{/gist_id}","starred_url":"https://api.github.com/users/rwsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwsu/subscriptions","organizations_url":"https://api.github.com/users/rwsu/orgs","repos_url":"https://api.github.com/users/rwsu/repos","events_url":"https://api.github.com/users/rwsu/events{/privacy}","received_events_url":"https://api.github.com/users/rwsu/received_events","type":"User","site_admin":false},"repo":{"id":30277850,"name":"manageiq","full_name":"rwsu/manageiq","owner":{"login":"rwsu","id":974403,"avatar_url":"https://avatars.githubusercontent.com/u/974403?v=3","gravatar_id":"","url":"https://api.github.com/users/rwsu","html_url":"https://github.com/rwsu","followers_url":"https://api.github.com/users/rwsu/followers","following_url":"https://api.github.com/users/rwsu/following{/other_user}","gists_url":"https://api.github.com/users/rwsu/gists{/gist_id}","starred_url":"https://api.github.com/users/rwsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwsu/subscriptions","organizations_url":"https://api.github.com/users/rwsu/orgs","repos_url":"https://api.github.com/users/rwsu/repos","events_url":"https://api.github.com/users/rwsu/events{/privacy}","received_events_url":"https://api.github.com/users/rwsu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwsu/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/rwsu/manageiq","forks_url":"https://api.github.com/repos/rwsu/manageiq/forks","keys_url":"https://api.github.com/repos/rwsu/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwsu/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwsu/manageiq/teams","hooks_url":"https://api.github.com/repos/rwsu/manageiq/hooks","issue_events_url":"https://api.github.com/repos/rwsu/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/rwsu/manageiq/events","assignees_url":"https://api.github.com/repos/rwsu/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/rwsu/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/rwsu/manageiq/tags","blobs_url":"https://api.github.com/repos/rwsu/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwsu/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwsu/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwsu/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwsu/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/rwsu/manageiq/languages","stargazers_url":"https://api.github.com/repos/rwsu/manageiq/stargazers","contributors_url":"https://api.github.com/repos/rwsu/manageiq/contributors","subscribers_url":"https://api.github.com/repos/rwsu/manageiq/subscribers","subscription_url":"https://api.github.com/repos/rwsu/manageiq/subscription","commits_url":"https://api.github.com/repos/rwsu/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwsu/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwsu/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwsu/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwsu/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/rwsu/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwsu/manageiq/merges","archive_url":"https://api.github.com/repos/rwsu/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwsu/manageiq/downloads","issues_url":"https://api.github.com/repos/rwsu/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/rwsu/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/rwsu/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/rwsu/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwsu/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/rwsu/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/rwsu/manageiq/deployments","created_at":"2015-02-04T02:49:25Z","updated_at":"2016-04-05T23:39:42Z","pushed_at":"2016-10-13T00:21:04Z","git_url":"git://github.com/rwsu/manageiq.git","ssh_url":"git@github.com:rwsu/manageiq.git","clone_url":"https://github.com/rwsu/manageiq.git","svn_url":"https://github.com/rwsu/manageiq","homepage":"manageiq.org","size":160387,"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":"ManageIQ:master","ref":"master","sha":"daae7ae3f709c2f04c1e34343b6ba6cbf6512159","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Open-Source Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-10-07T20:22:27Z","pushed_at":"2016-10-13T08:15:22Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":211324,"stargazers_count":335,"watchers_count":335,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":368,"mirror_url":null,"open_issues_count":866,"forks":368,"open_issues":866,"watchers":335,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/11634"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/11634"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/11634/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/11634/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/da5cddef6509e5d54457ca2dd7885f088ca84265"}}}}
{"actor":{"display_login":"romanblanco"}}