{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/24821440","id":24821440,"diff_hunk":"@@ -202,6 +204,19 @@ def sync_name\n       end\n     end\n \n+    def validate_host_taxonomy\n+      return true if self.subnet.nil?\n+      return true if self.host.organization.nil? && self.subnet.organizations.empty? &&\n+                     self.host.location.nil? && self.subnet.locations.empty?\n+\n+      errors.add(:subnet, _(\"is not defined for host\\'s organization.\")) unless include_or_empty?(self.subnet.organizations, self.host.organization)","path":"app/models/nic/base.rb","position":18,"original_position":18,"commit_id":"829f000a1b4c2aa526b0587b93c2ebaa79bbd01e","original_commit_id":"829f000a1b4c2aa526b0587b93c2ebaa79bbd01e","user":{"login":"ohadlevy","id":20167,"avatar_url":"https://avatars.githubusercontent.com/u/20167?v=3","gravatar_id":"","url":"https://api.github.com/users/ohadlevy","html_url":"https://github.com/ohadlevy","followers_url":"https://api.github.com/users/ohadlevy/followers","following_url":"https://api.github.com/users/ohadlevy/following{/other_user}","gists_url":"https://api.github.com/users/ohadlevy/gists{/gist_id}","starred_url":"https://api.github.com/users/ohadlevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohadlevy/subscriptions","organizations_url":"https://api.github.com/users/ohadlevy/orgs","repos_url":"https://api.github.com/users/ohadlevy/repos","events_url":"https://api.github.com/users/ohadlevy/events{/privacy}","received_events_url":"https://api.github.com/users/ohadlevy/received_events","type":"User","site_admin":false},"body":"does this also apply for domains and other interface / host properties ?","created_at":"2015-02-17T15:09:02Z","updated_at":"2015-02-17T15:09:02Z","html_url":"https://github.com/theforeman/foreman/pull/2173#discussion_r24821440","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/2173","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/24821440"},"html":{"href":"https://github.com/theforeman/foreman/pull/2173#discussion_r24821440"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2173"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/2173","id":29448385,"html_url":"https://github.com/theforeman/foreman/pull/2173","diff_url":"https://github.com/theforeman/foreman/pull/2173.diff","patch_url":"https://github.com/theforeman/foreman/pull/2173.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/2173","number":2173,"state":"open","locked":false,"title":"fixes #9391 - Added validation code to NIC","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 it validates that host's location/org is compatible with the one set on NIC's subnet","created_at":"2015-02-17T15:04:36Z","updated_at":"2015-02-17T15:09:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a31062a084dedb6fb5f625b2e25408d610e0b18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/2173/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/2173/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/{number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/2173/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/829f000a1b4c2aa526b0587b93c2ebaa79bbd01e","head":{"label":"ShimShtein:9391","ref":"9391","sha":"829f000a1b4c2aa526b0587b93c2ebaa79bbd01e","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}","created_at":"2014-12-02T11:40:34Z","updated_at":"2015-02-15T11:27:00Z","pushed_at":"2015-02-17T15:00:28Z","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":27458,"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":"6b5795288948058b845c78b084444453f0d7f2e1","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}","created_at":"2009-07-23T15:07:00Z","updated_at":"2015-02-17T09:55:09Z","pushed_at":"2015-02-17T09:55:09Z","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":67727,"stargazers_count":671,"watchers_count":671,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":367,"mirror_url":null,"open_issues_count":97,"forks":367,"open_issues":97,"watchers":671,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2173"},"html":{"href":"https://github.com/theforeman/foreman/pull/2173"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2173"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2173/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2173/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2173/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/829f000a1b4c2aa526b0587b93c2ebaa79bbd01e"}}}}