{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/115563580","pull_request_review_id":37112341,"id":115563580,"diff_hunk":"@@ -398,33 +398,47 @@ def get_datapath_id_for_ovsbridge(bridge)\n \n   # Do some MTU checks/configuration for the parent of the vlan nic\n   if nic.is_a?(Nic::Vlan)\n-    # 1) validate that the parent of vlan nic is not used by a network directly\n-    # and the requested mtu for the parent is lower than the vlan nic mtu.\n-    # That would not work and setting the mtu on the vlan would fail.\n-    networks_using_parent = if_mapping.select { |net, ifaces| ifaces.include? nic.parent }.keys\n-    networks_using_parent.each do |net_name|\n-      net = Barclamp::Inventory.get_network_by_type(node, net_name)\n-      unless net.use_vlan\n-        nic_parent = Nic.new nic.parent\n-        if nic_parent.mtu.to_i < ifs[nic.name][\"mtu\"].to_i\n-          msg = \"#{nic.name} wants mtu #{ifs[nic.name][\"mtu\"]} but network #{net_name} \" \\\n-                \"using the parent nic #{nic.parent} wants a lower mtu #{net.mtu}. \" \\\n-                \"This network mtu configuration is invalid.\"\n+    if nic.parent\n+      parent_nic = Nic.new(nic.parent)\n+      Chef::Log.info(\"Checking MTU for nic #{nic.name} with parent #{parent_nic.name}\")\n+      if parent_nic.is_a?(Nic::Bond)\n+        # parent is a bond\n+        # check bond slaves interfaces for mtu values\n+        parent_nic.slaves.each do |bond_iface|\n+          next unless ifs[nic.name].key?(\"mtu\") &&\n+            ifs[bond_iface.name] &&\n+            ifs[bond_iface.name].key?(\"mtu\") &&\n+            ifs[bond_iface.name][\"mtu\"] < ifs[nic.name][\"mtu\"]\n+          msg = \"Interface #{bond_iface.name}, part of bond #{parent_nic.name} has a \"\\\n+               \"custom mtu of #{ifs[bond_iface.name][\"mtu\"]} but children vlan #{nic.name} \"\\\n+               \"wants a mtu of #{ifs[nic.name][\"mtu\"]}. This configuration is invalid.\"\n+          Chef::Log.fatal(msg)\n+          raise msg\n+        end\n+        # no problems, set the highest mtu of the bond's children\n+        all_children = ifs.select { |k, v| v[\"parent\"] == nic.parent && v.key?(\"mtu\") }\n+        max_mtu_nic = all_children.max_by{ |k, v| v[\"mtu\"] }[0]\n+      else\n+        # parent is not a bond\n+        if ifs[nic.name].key?(\"mtu\") &&\n+          ifs.key?(parent_nic.name) &&\n+          ifs[parent_nic.name].key?(\"mtu\") &&\n+          ifs[parent_nic.name][\"mtu\"] < ifs[nic.name][\"mtu\"]","path":"chef/cookbooks/network/recipes/default.rb","position":41,"original_position":41,"commit_id":"13ae9f7e5161237f1fb33c125a2c450caff0b59e","original_commit_id":"13ae9f7e5161237f1fb33c125a2c450caff0b59e","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Style/MultilineOperationIndentation: Use 4 (not 2) spaces for indenting a condition in an if statement spanning multiple lines. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylemultilineoperationindentation)","created_at":"2017-05-09T18:20:27Z","updated_at":"2017-05-09T18:20:28Z","html_url":"https://github.com/crowbar/crowbar-core/pull/1228#discussion_r115563580","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/115563580"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/1228#discussion_r115563580"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228","id":117978435,"html_url":"https://github.com/crowbar/crowbar-core/pull/1228","diff_url":"https://github.com/crowbar/crowbar-core/pull/1228.diff","patch_url":"https://github.com/crowbar/crowbar-core/pull/1228.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/1228","number":1228,"state":"open","locked":false,"title":"network: set max mtu of a parent to the max of its children","user":{"login":"Itxaka","id":1447686,"avatar_url":"https://avatars0.githubusercontent.com/u/1447686?v=3","gravatar_id":"","url":"https://api.github.com/users/Itxaka","html_url":"https://github.com/Itxaka","followers_url":"https://api.github.com/users/Itxaka/followers","following_url":"https://api.github.com/users/Itxaka/following{/other_user}","gists_url":"https://api.github.com/users/Itxaka/gists{/gist_id}","starred_url":"https://api.github.com/users/Itxaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itxaka/subscriptions","organizations_url":"https://api.github.com/users/Itxaka/orgs","repos_url":"https://api.github.com/users/Itxaka/repos","events_url":"https://api.github.com/users/Itxaka/events{/privacy}","received_events_url":"https://api.github.com/users/Itxaka/received_events","type":"User","site_admin":false},"body":"iterate over all the children to obtain the max mtu that we need to\r\nset to a parent nic. Before this, only the first vlan children of a parent\r\nwas used to set an mtu value, failing afterwards if the next vlan had a bigger\r\nvalue.\r\n\r\nIntroduced in https://github.com/crowbar/crowbar-core/pull/1084\r\n\r\ncc @nvin-krja","created_at":"2017-04-27T16:20:40Z","updated_at":"2017-05-09T18:20:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a38eedeb14fa921951883b0a8f2bc83026d00465","assignee":null,"assignees":[],"requested_reviewers":[{"login":"toabctl","id":276317,"avatar_url":"https://avatars3.githubusercontent.com/u/276317?v=3","gravatar_id":"","url":"https://api.github.com/users/toabctl","html_url":"https://github.com/toabctl","followers_url":"https://api.github.com/users/toabctl/followers","following_url":"https://api.github.com/users/toabctl/following{/other_user}","gists_url":"https://api.github.com/users/toabctl/gists{/gist_id}","starred_url":"https://api.github.com/users/toabctl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toabctl/subscriptions","organizations_url":"https://api.github.com/users/toabctl/orgs","repos_url":"https://api.github.com/users/toabctl/repos","events_url":"https://api.github.com/users/toabctl/events{/privacy}","received_events_url":"https://api.github.com/users/toabctl/received_events","type":"User","site_admin":false},{"login":"vuntz","id":1758783,"avatar_url":"https://avatars0.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/1228/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/13ae9f7e5161237f1fb33c125a2c450caff0b59e","head":{"label":"Itxaka:fix_max_mtu_for_parent","ref":"fix_max_mtu_for_parent","sha":"13ae9f7e5161237f1fb33c125a2c450caff0b59e","user":{"login":"Itxaka","id":1447686,"avatar_url":"https://avatars0.githubusercontent.com/u/1447686?v=3","gravatar_id":"","url":"https://api.github.com/users/Itxaka","html_url":"https://github.com/Itxaka","followers_url":"https://api.github.com/users/Itxaka/followers","following_url":"https://api.github.com/users/Itxaka/following{/other_user}","gists_url":"https://api.github.com/users/Itxaka/gists{/gist_id}","starred_url":"https://api.github.com/users/Itxaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itxaka/subscriptions","organizations_url":"https://api.github.com/users/Itxaka/orgs","repos_url":"https://api.github.com/users/Itxaka/repos","events_url":"https://api.github.com/users/Itxaka/events{/privacy}","received_events_url":"https://api.github.com/users/Itxaka/received_events","type":"User","site_admin":false},"repo":{"id":63080754,"name":"crowbar-core","full_name":"Itxaka/crowbar-core","owner":{"login":"Itxaka","id":1447686,"avatar_url":"https://avatars0.githubusercontent.com/u/1447686?v=3","gravatar_id":"","url":"https://api.github.com/users/Itxaka","html_url":"https://github.com/Itxaka","followers_url":"https://api.github.com/users/Itxaka/followers","following_url":"https://api.github.com/users/Itxaka/following{/other_user}","gists_url":"https://api.github.com/users/Itxaka/gists{/gist_id}","starred_url":"https://api.github.com/users/Itxaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itxaka/subscriptions","organizations_url":"https://api.github.com/users/Itxaka/orgs","repos_url":"https://api.github.com/users/Itxaka/repos","events_url":"https://api.github.com/users/Itxaka/events{/privacy}","received_events_url":"https://api.github.com/users/Itxaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Itxaka/crowbar-core","description":"Core deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/Itxaka/crowbar-core","forks_url":"https://api.github.com/repos/Itxaka/crowbar-core/forks","keys_url":"https://api.github.com/repos/Itxaka/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Itxaka/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Itxaka/crowbar-core/teams","hooks_url":"https://api.github.com/repos/Itxaka/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/Itxaka/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/Itxaka/crowbar-core/events","assignees_url":"https://api.github.com/repos/Itxaka/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/Itxaka/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/Itxaka/crowbar-core/tags","blobs_url":"https://api.github.com/repos/Itxaka/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Itxaka/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Itxaka/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Itxaka/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Itxaka/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/Itxaka/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/Itxaka/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/Itxaka/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/Itxaka/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/Itxaka/crowbar-core/subscription","commits_url":"https://api.github.com/repos/Itxaka/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Itxaka/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Itxaka/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Itxaka/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Itxaka/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/Itxaka/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Itxaka/crowbar-core/merges","archive_url":"https://api.github.com/repos/Itxaka/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Itxaka/crowbar-core/downloads","issues_url":"https://api.github.com/repos/Itxaka/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/Itxaka/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/Itxaka/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/Itxaka/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Itxaka/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/Itxaka/crowbar-core/releases{/id}","deployments_url":"https://api.github.com/repos/Itxaka/crowbar-core/deployments","created_at":"2016-07-11T15:42:52Z","updated_at":"2016-07-11T15:42:54Z","pushed_at":"2017-05-09T18:20:16Z","git_url":"git://github.com/Itxaka/crowbar-core.git","ssh_url":"git@github.com:Itxaka/crowbar-core.git","clone_url":"https://github.com/Itxaka/crowbar-core.git","svn_url":"https://github.com/Itxaka/crowbar-core","homepage":null,"size":108238,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"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":"crowbar:master","ref":"master","sha":"a3096b9b01c8badaa80a79274c03ed3ad02633bc","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars1.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":39003227,"name":"crowbar-core","full_name":"crowbar/crowbar-core","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars1.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/crowbar-core","description":"Core deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-core","forks_url":"https://api.github.com/repos/crowbar/crowbar-core/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-core/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-core/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-core/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-core/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-core/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-core/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-core/releases{/id}","deployments_url":"https://api.github.com/repos/crowbar/crowbar-core/deployments","created_at":"2015-07-13T09:31:28Z","updated_at":"2017-04-12T10:15:20Z","pushed_at":"2017-05-09T18:20:18Z","git_url":"git://github.com/crowbar/crowbar-core.git","ssh_url":"git@github.com:crowbar/crowbar-core.git","clone_url":"https://github.com/crowbar/crowbar-core.git","svn_url":"https://github.com/crowbar/crowbar-core","homepage":null,"size":108231,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":49,"forks":42,"open_issues":49,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/1228"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/1228"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/1228/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/1228/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-core/statuses/13ae9f7e5161237f1fb33c125a2c450caff0b59e"}}}}
{"actor":{"display_login":"houndci-bot"}}