GitHub PullRequestReviewCommentEvent at 2014-10-08 14:49:29
Repository: foreman-installer-staypuft
Actor: jistr
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/comments/18586797","id":18586797,"diff_hunk":"@@ -638,16 +639,78 @@ def kickstart_networking_setup_snippet\n <% unless dhcp -%>\n IPADDR=\"<%= @host.ip -%>\"\n NETMASK=\"<%= subnet.mask -%>\"\n+GATEWAY=\"<%= subnet.gateway -%>\"\n <% end -%>\n DEVICE=\"$real\"\n HWADDR=\"<%= @host.mac -%>\"\n ONBOOT=yes\n+EOF\n+<% end -%>\n+\n+<% bonded_interfaces = [] %>\n+<% bonds = @host.bond_interfaces %>\n+<% bonds.each do |bond| %>\n+# <%= bond.identifier %> interface\n+real=\"<%= bond.identifier -%>\"\n+cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real\n+BOOTPROTO=\"<%= dhcp ? 'dhcp' : 'none' -%>\"\n+<% unless dhcp -%>\n+IPADDR=\"<%= bond.ip -%>\"\n+NETMASK=\"<%= subnet.mask -%>\"\n+GATEWAY=\"<%= subnet.gateway -%>\"\n+<% end -%>\n+DEVICE=\"$real\"\n+ONBOOT=yes\n+PEERDNS=no\n+PEERROUTES=no\n+DEFROUTE=no\n+TYPE=Bond\n+BONDING_OPTS=\"<%= bond.bond_options -%> mode=<%= bond.mode -%>\"\n+BONDING_MASTER=yes\n NM_CONTROLLED=no\n EOF\n+\n+<% @host.interfaces_with_identifier(bond.attached_devices_identifiers).each do |interface| -%>\n+<% next if !interface.managed? -%>\n+\n+<% subnet = interface.subnet -%>\n+<% virtual = interface.virtual? -%>\n+<% vlan = virtual && subnet.has_vlanid? -%>\n+<% alias_type = virtual && !subnet.nil? && !subnet.has_vlanid? && interface.identifier.include?(':') -%>\n+<% dhcp = !subnet.nil? && subnet.dhcp_boot_mode? -%>\n+\n+# <%= interface.identifier %> interface\n+real=`ip -o link | grep <%= interface.mac -%> | awk '{print $2;}' | sed s/:$//`\n+<% if virtual -%>\n+real=`echo <%= interface.identifier -%> | sed s/<%= interface.attached_to -%>/$real/`\n <% end -%>\n \n-<% @host.interfaces.each do |interface| %>\n+cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real\n+BOOTPROTO=\"none\"\n+DEVICE=\"$real\"\n+<% unless virtual -%>\n+HWADDR=\"<%= interface.mac -%>\"\n+<% end -%>\n+ONBOOT=yes\n+PEERDNS=no\n+PEERROUTES=no\n+<% if vlan -%>\n+VLAN=yes\n+<% elsif alias_type -%>\n+TYPE=Alias\n+<% end -%>\n+NM_CONTROLLED=no\n+MASTER=<%= bond.identifier %>\n+SLAVE=yes\n+EOF\n+\n+<% bonded_interfaces.push(interface.identifier) -%>\n+<% end %>\n+<% end %>\n+\n+<% @host.managed_interfaces.each do |interface| %>\n <% next if !interface.managed? || interface.subnet.nil? -%>\n+<% next if bonded_interfaces.include?(interface.identifier) -%>","path":"hooks/lib/provisioning_seeder.rb","position":84,"original_position":84,"commit_id":"f281480227deac07c561922dc7cbfd0b8a7362b5","original_commit_id":"f281480227deac07c561922dc7cbfd0b8a7362b5","user":{"login":"jistr","id":331840,"avatar_url":"https://avatars.githubusercontent.com/u/331840?v=2","gravatar_id":"","url":"https://api.github.com/users/jistr","html_url":"https://github.com/jistr","followers_url":"https://api.github.com/users/jistr/followers","following_url":"https://api.github.com/users/jistr/following{/other_user}","gists_url":"https://api.github.com/users/jistr/gists{/gist_id}","starred_url":"https://api.github.com/users/jistr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jistr/subscriptions","organizations_url":"https://api.github.com/users/jistr/orgs","repos_url":"https://api.github.com/users/jistr/repos","events_url":"https://api.github.com/users/jistr/events{/privacy}","received_events_url":"https://api.github.com/users/jistr/received_events","type":"User","site_admin":false},"body":"(Disclaimer: i'm a networking newbie so it's possible that my question is dumb.)\r\n\r\nI see that this will exclude all the `bond.attached_devices_identifiers` for each `bond`, but will this also exclude the `bond` itself (the bonding master)? I don't see that being added to `bonded_interfaces`. Or is it that `@host.bond_interfaces` never appear in `@host.managed_interfaces`?","created_at":"2014-10-08T14:49:29Z","updated_at":"2014-10-08T14:49:29Z","html_url":"https://github.com/theforeman/foreman-installer-staypuft/pull/95#discussion_r18586797","pull_request_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/comments/18586797"},"html":{"href":"https://github.com/theforeman/foreman-installer-staypuft/pull/95#discussion_r18586797"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95","id":21767277,"html_url":"https://github.com/theforeman/foreman-installer-staypuft/pull/95","diff_url":"https://github.com/theforeman/foreman-installer-staypuft/pull/95.diff","patch_url":"https://github.com/theforeman/foreman-installer-staypuft/pull/95.patch","issue_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/issues/95","number":95,"state":"open","locked":false,"title":"Install provisioning template that configures bonds","user":{"login":"ares","id":109773,"avatar_url":"https://avatars.githubusercontent.com/u/109773?v=2","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-25T08:18:54Z","updated_at":"2014-10-08T14:49:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb5f45edde11f29e782ce136de7b3a4e3b4db7e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/comments/{number}","comments_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/issues/95/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/statuses/f281480227deac07c561922dc7cbfd0b8a7362b5","head":{"label":"ares:bonding","ref":"bonding","sha":"f281480227deac07c561922dc7cbfd0b8a7362b5","user":{"login":"ares","id":109773,"avatar_url":"https://avatars.githubusercontent.com/u/109773?v=2","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"repo":{"id":19242602,"name":"foreman-installer-staypuft","full_name":"ares/foreman-installer-staypuft","owner":{"login":"ares","id":109773,"avatar_url":"https://avatars.githubusercontent.com/u/109773?v=2","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ares/foreman-installer-staypuft","description":"Foreman installer plugin that helps with staypuft Foreman plugin installation","fork":true,"url":"https://api.github.com/repos/ares/foreman-installer-staypuft","forks_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/forks","keys_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/teams","hooks_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/hooks","issue_events_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/issues/events{/number}","events_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/events","assignees_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/assignees{/user}","branches_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/branches{/branch}","tags_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/tags","blobs_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/git/refs{/sha}","trees_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/statuses/{sha}","languages_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/languages","stargazers_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/stargazers","contributors_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/contributors","subscribers_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/subscribers","subscription_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/subscription","commits_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/commits{/sha}","git_commits_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/git/commits{/sha}","comments_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/comments{/number}","issue_comment_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/issues/comments/{number}","contents_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/contents/{+path}","compare_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/merges","archive_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/downloads","issues_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/issues{/number}","pulls_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/pulls{/number}","milestones_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/milestones{/number}","notifications_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/labels{/name}","releases_url":"https://api.github.com/repos/ares/foreman-installer-staypuft/releases{/id}","created_at":"2014-04-28T14:57:59Z","updated_at":"2014-06-26T12:45:43Z","pushed_at":"2014-09-26T11:52:38Z","git_url":"git://github.com/ares/foreman-installer-staypuft.git","ssh_url":"git@github.com:ares/foreman-installer-staypuft.git","clone_url":"https://github.com/ares/foreman-installer-staypuft.git","svn_url":"https://github.com/ares/foreman-installer-staypuft","homepage":null,"size":1805,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"17c3fa3e217eb8944d0765059fbe30a14631b1fc","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=2","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":19075309,"name":"foreman-installer-staypuft","full_name":"theforeman/foreman-installer-staypuft","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=2","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-installer-staypuft","description":"Foreman installer plugin that helps with staypuft Foreman plugin installation","fork":false,"url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft","forks_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/forks","keys_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/events","assignees_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/issues/comments/{number}","contents_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/merges","archive_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/releases{/id}","created_at":"2014-04-23T15:38:28Z","updated_at":"2014-09-02T15:07:05Z","pushed_at":"2014-10-02T07:05:00Z","git_url":"git://github.com/theforeman/foreman-installer-staypuft.git","ssh_url":"git@github.com:theforeman/foreman-installer-staypuft.git","clone_url":"https://github.com/theforeman/foreman-installer-staypuft.git","svn_url":"https://github.com/theforeman/foreman-installer-staypuft","homepage":null,"size":2994,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":5,"forks":16,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95"},"html":{"href":"https://github.com/theforeman/foreman-installer-staypuft/pull/95"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/issues/95"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman-installer-staypuft/statuses/f281480227deac07c561922dc7cbfd0b8a7362b5"}}}}