{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments/144881420","pull_request_review_id":69600424,"id":144881420,"diff_hunk":"@@ -293,9 +303,81 @@ def active_update(proposal, inst, in_queue, bootstrap = false)\n     super\n   end\n \n+  def validate_mcast_addr(used_addrs, ring_index, curr_addr)\n+    # compare current address to used addresses\n+    curr_addr_used = (curr_addr != \"\") && (used_addrs.key? curr_addr)\n+\n+    # if address is used or empty, find an available address\n+    if curr_addr_used || curr_addr == \"\"\n+      free_addr = next_available_mcast_addr(used_addrs)\n+      if free_addr\n+        if curr_addr_used\n+          validation_error I18n.t(\n+            \"barclamp.#{bc_name}.validation.mcast_addr_used_free\",\n+            ring_index: ring_index + 1,\n+            used_addr: curr_addr,\n+            free_addr: free_addr\n+          )\n+        else\n+          validation_error I18n.t(\n+            \"barclamp.#{bc_name}.validation.mcast_addr_empty_free\",\n+            ring_index: ring_index + 1,\n+            free_addr: free_addr\n+          )\n+        end\n+        return free_addr\n+      elsif curr_addr_used\n+        validation_error I18n.t(\n+          \"barclamp.#{bc_name}.validation.mcast_addr_used_none_avail\",\n+          used_addr: curr_addr\n+        )\n+      else\n+        validation_error I18n.t(\n+          \"barclamp.#{bc_name}.validation.mcast_addr_none_avail\"\n+        )\n+      end\n+    end\n+\n+    curr_addr\n+  end\n+\n+  def allocate_member_addresses(nodes, network)\n+    members = []\n+\n+    net_svc = NetworkService.new @logger\n+    nodes.each_with_index do |node, node_index|\n+      addr = node.get_network_by_type(network)\n+      if addr\n+        addr = addr[\"address\"]\n+      else\n+        # save node before allocate_ip updates db directly\n+        node.save\n+\n+        # allocate address\n+        result = net_svc.allocate_ip \"default\", network, \"host\", node.name\n+        if result[0] == 200\n+          addr = result[1][\"address\"]\n+        else\n+          raise I18n.t(\n+            \"barclamp.#{bc_name}.validation.allocate_ip\",\n+            node: node.name,\n+            network: network,\n+            retcode: result[0]\n+          )\n+        end\n+\n+        # reload node after allocate_ip\n+        nodes[node_index] = NodeObject.find_node_by_name(node.name)\n+      end\n+      members.push(addr)\n+    end\n+    members\n+  end\n+\n   def apply_role_pre_chef_call(old_role, role, all_nodes)\n     @logger.debug(\"Pacemaker apply_role_pre_chef_call: entering #{all_nodes.inspect}\")\n \n+    proposal = Proposal.find_by(barclamp: @bc_name, name: role.inst)","path":"crowbar_framework/app/models/pacemaker_service.rb","position":143,"original_position":143,"commit_id":"b0f792006b7e0d66d1fbb859885ef1f6b881f338","original_commit_id":"b0f792006b7e0d66d1fbb859885ef1f6b881f338","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","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":"Lint/UselessAssignment: Useless assignment to variable - proposal. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)","created_at":"2017-10-16T15:30:03Z","updated_at":"2017-10-16T15:30:03Z","html_url":"https://github.com/crowbar/crowbar-ha/pull/239#discussion_r144881420","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments/144881420"},"html":{"href":"https://github.com/crowbar/crowbar-ha/pull/239#discussion_r144881420"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239","id":141026678,"html_url":"https://github.com/crowbar/crowbar-ha/pull/239","diff_url":"https://github.com/crowbar/crowbar-ha/pull/239.diff","patch_url":"https://github.com/crowbar/crowbar-ha/pull/239.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/239","number":239,"state":"open","locked":false,"title":"Add support for multiple Corosync rings","user":{"login":"scottwulf","id":30256229,"avatar_url":"https://avatars2.githubusercontent.com/u/30256229?v=4","gravatar_id":"","url":"https://api.github.com/users/scottwulf","html_url":"https://github.com/scottwulf","followers_url":"https://api.github.com/users/scottwulf/followers","following_url":"https://api.github.com/users/scottwulf/following{/other_user}","gists_url":"https://api.github.com/users/scottwulf/gists{/gist_id}","starred_url":"https://api.github.com/users/scottwulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottwulf/subscriptions","organizations_url":"https://api.github.com/users/scottwulf/orgs","repos_url":"https://api.github.com/users/scottwulf/repos","events_url":"https://api.github.com/users/scottwulf/events{/privacy}","received_events_url":"https://api.github.com/users/scottwulf/received_events","type":"User","site_admin":false},"body":"For increased availability, people want the ability to configure multiple Corosync rings so that if one network fails nodes do not become fenced.\r\n\r\nThese commits will introduce a second set of attributes in the Pacemaker code to support a second Corosync ring and will modify the Corosync code to support _**n**_ number of rings.\r\n","created_at":"2017-09-14T09:38:44Z","updated_at":"2017-10-16T15:30:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1bf90bcf0ce80428f1c77603c7eb01e5d934d5c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/239/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-ha/statuses/b0f792006b7e0d66d1fbb859885ef1f6b881f338","head":{"label":"scottwulf:corosync-multiple-rings","ref":"corosync-multiple-rings","sha":"b0f792006b7e0d66d1fbb859885ef1f6b881f338","user":{"login":"scottwulf","id":30256229,"avatar_url":"https://avatars2.githubusercontent.com/u/30256229?v=4","gravatar_id":"","url":"https://api.github.com/users/scottwulf","html_url":"https://github.com/scottwulf","followers_url":"https://api.github.com/users/scottwulf/followers","following_url":"https://api.github.com/users/scottwulf/following{/other_user}","gists_url":"https://api.github.com/users/scottwulf/gists{/gist_id}","starred_url":"https://api.github.com/users/scottwulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottwulf/subscriptions","organizations_url":"https://api.github.com/users/scottwulf/orgs","repos_url":"https://api.github.com/users/scottwulf/repos","events_url":"https://api.github.com/users/scottwulf/events{/privacy}","received_events_url":"https://api.github.com/users/scottwulf/received_events","type":"User","site_admin":false},"repo":{"id":103510840,"name":"crowbar-ha","full_name":"scottwulf/crowbar-ha","owner":{"login":"scottwulf","id":30256229,"avatar_url":"https://avatars2.githubusercontent.com/u/30256229?v=4","gravatar_id":"","url":"https://api.github.com/users/scottwulf","html_url":"https://github.com/scottwulf","followers_url":"https://api.github.com/users/scottwulf/followers","following_url":"https://api.github.com/users/scottwulf/following{/other_user}","gists_url":"https://api.github.com/users/scottwulf/gists{/gist_id}","starred_url":"https://api.github.com/users/scottwulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottwulf/subscriptions","organizations_url":"https://api.github.com/users/scottwulf/orgs","repos_url":"https://api.github.com/users/scottwulf/repos","events_url":"https://api.github.com/users/scottwulf/events{/privacy}","received_events_url":"https://api.github.com/users/scottwulf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scottwulf/crowbar-ha","description":"HA deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/scottwulf/crowbar-ha","forks_url":"https://api.github.com/repos/scottwulf/crowbar-ha/forks","keys_url":"https://api.github.com/repos/scottwulf/crowbar-ha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scottwulf/crowbar-ha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scottwulf/crowbar-ha/teams","hooks_url":"https://api.github.com/repos/scottwulf/crowbar-ha/hooks","issue_events_url":"https://api.github.com/repos/scottwulf/crowbar-ha/issues/events{/number}","events_url":"https://api.github.com/repos/scottwulf/crowbar-ha/events","assignees_url":"https://api.github.com/repos/scottwulf/crowbar-ha/assignees{/user}","branches_url":"https://api.github.com/repos/scottwulf/crowbar-ha/branches{/branch}","tags_url":"https://api.github.com/repos/scottwulf/crowbar-ha/tags","blobs_url":"https://api.github.com/repos/scottwulf/crowbar-ha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scottwulf/crowbar-ha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scottwulf/crowbar-ha/git/refs{/sha}","trees_url":"https://api.github.com/repos/scottwulf/crowbar-ha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scottwulf/crowbar-ha/statuses/{sha}","languages_url":"https://api.github.com/repos/scottwulf/crowbar-ha/languages","stargazers_url":"https://api.github.com/repos/scottwulf/crowbar-ha/stargazers","contributors_url":"https://api.github.com/repos/scottwulf/crowbar-ha/contributors","subscribers_url":"https://api.github.com/repos/scottwulf/crowbar-ha/subscribers","subscription_url":"https://api.github.com/repos/scottwulf/crowbar-ha/subscription","commits_url":"https://api.github.com/repos/scottwulf/crowbar-ha/commits{/sha}","git_commits_url":"https://api.github.com/repos/scottwulf/crowbar-ha/git/commits{/sha}","comments_url":"https://api.github.com/repos/scottwulf/crowbar-ha/comments{/number}","issue_comment_url":"https://api.github.com/repos/scottwulf/crowbar-ha/issues/comments{/number}","contents_url":"https://api.github.com/repos/scottwulf/crowbar-ha/contents/{+path}","compare_url":"https://api.github.com/repos/scottwulf/crowbar-ha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scottwulf/crowbar-ha/merges","archive_url":"https://api.github.com/repos/scottwulf/crowbar-ha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scottwulf/crowbar-ha/downloads","issues_url":"https://api.github.com/repos/scottwulf/crowbar-ha/issues{/number}","pulls_url":"https://api.github.com/repos/scottwulf/crowbar-ha/pulls{/number}","milestones_url":"https://api.github.com/repos/scottwulf/crowbar-ha/milestones{/number}","notifications_url":"https://api.github.com/repos/scottwulf/crowbar-ha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scottwulf/crowbar-ha/labels{/name}","releases_url":"https://api.github.com/repos/scottwulf/crowbar-ha/releases{/id}","deployments_url":"https://api.github.com/repos/scottwulf/crowbar-ha/deployments","created_at":"2017-09-14T09:03:22Z","updated_at":"2017-09-14T09:03:24Z","pushed_at":"2017-10-16T15:29:49Z","git_url":"git://github.com/scottwulf/crowbar-ha.git","ssh_url":"git@github.com:scottwulf/crowbar-ha.git","clone_url":"https://github.com/scottwulf/crowbar-ha.git","svn_url":"https://github.com/scottwulf/crowbar-ha","homepage":"","size":1495,"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":"63bfc1243c98b3ba88e6daec29ba15ce93a5f283","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars2.githubusercontent.com/u/2910205?v=4","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":39006836,"name":"crowbar-ha","full_name":"crowbar/crowbar-ha","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars2.githubusercontent.com/u/2910205?v=4","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-ha","description":"HA deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-ha","forks_url":"https://api.github.com/repos/crowbar/crowbar-ha/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-ha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-ha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-ha/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-ha/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-ha/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-ha/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-ha/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-ha/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-ha/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-ha/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-ha/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-ha/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-ha/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-ha/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-ha/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-ha/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-ha/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-ha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-ha/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-ha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-ha/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-ha/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-ha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-ha/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-ha/releases{/id}","deployments_url":"https://api.github.com/repos/crowbar/crowbar-ha/deployments","created_at":"2015-07-13T10:53:43Z","updated_at":"2017-10-12T09:47:51Z","pushed_at":"2017-10-16T15:29:52Z","git_url":"git://github.com/crowbar/crowbar-ha.git","ssh_url":"git@github.com:crowbar/crowbar-ha.git","clone_url":"https://github.com/crowbar/crowbar-ha.git","svn_url":"https://github.com/crowbar/crowbar-ha","homepage":"","size":1513,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":17,"forks":30,"open_issues":17,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239"},"html":{"href":"https://github.com/crowbar/crowbar-ha/pull/239"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/issues/239"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/issues/239/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/239/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/statuses/b0f792006b7e0d66d1fbb859885ef1f6b881f338"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}