{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/195647068","pull_request_review_id":129057683,"id":195647068,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTY0NzA2OA==","diff_hunk":"@@ -75,17 +100,59 @@ def self.database_settings(node, barclamp)\n       @database_settings_cache_time = node[:ohai_time]\n     end\n \n-    if @database_settings && @database_settings.include?(instance)\n+    if @database_settings && @database_settings.include?(instance) && false\n+      # FIXME: Skip the cache for now\n       Chef::Log.info(\"Database server found at #{@database_settings[instance][:address]} [cached]\")\n     else\n       @database_settings ||= Hash.new\n-      database = get_node(node, \"database-server\", \"database\", instance)\n+      database_nodes, = Chef::Search::Query.new.search(:node, \"roles:database-server\")\n \n-      if database.nil?\n+      if database_nodes.empty?\n+        # Should this be an error?\n         Chef::Log.warn(\"No database server found!\")\n+        # TODO\n+      elsif false\n+        # Check if anything other than 1 or 2 databases were returned\n+        # Raise an error if so\n+        Chef::Log.warn(\"Somehow there are more than 2 databases deployed.\")\n+        # TODO\n+      elsif false\n+        # If we have 2 separate database nodes handle selecting one\n+        # Check that there is one postgres and one mariadb. Raise an error if not\n+        # Use postgres first\n+        Chef::Log.info(\"We have 2 different database nodes\")\n+\n+        # Inspect both the nodes and figure out which engine is deployed to which\n+        # Prefer postgres over mariadb unless `engine` is given\n+        # TODO\n       else\n-        address = CrowbarDatabaseHelper.get_listen_address(database)\n-        backend_name = DatabaseLibrary::Database::Util.get_backend_name(database)\n+        # We only have one database node, but we need to check if it has multiple\n+        # proposals\n+        database = database_nodes.first\n+\n+        database_roles = database[\"roles\"].select{|roles| roles.match(/^database-config-/)}","path":"chef/cookbooks/crowbar-openstack/libraries/helpers.rb","position":82,"original_position":82,"commit_id":"01728fefe5e0508246dce124fe07ca69d2d38ef3","original_commit_id":"01728fefe5e0508246dce124fe07ca69d2d38ef3","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","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":"Layout/SpaceBeforeBlockBraces: Space missing to the left of {.<br>Layout/SpaceInsideBlockBraces: Space between { and | missing.<br>Layout/SpaceInsideBlockBraces: Space missing inside }.","created_at":"2018-06-15T06:56:54Z","updated_at":"2018-06-15T06:56:56Z","html_url":"https://github.com/crowbar/crowbar-openstack/pull/1685#discussion_r195647068","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/195647068"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/1685#discussion_r195647068"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685","id":195091413,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MDkxNDEz","html_url":"https://github.com/crowbar/crowbar-openstack/pull/1685","diff_url":"https://github.com/crowbar/crowbar-openstack/pull/1685.diff","patch_url":"https://github.com/crowbar/crowbar-openstack/pull/1685.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/1685","number":1685,"state":"open","locked":false,"title":"WIP/POC Dual DB support for migrations","user":{"login":"jhesketh","id":728450,"node_id":"MDQ6VXNlcjcyODQ1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/728450?v=4","gravatar_id":"","url":"https://api.github.com/users/jhesketh","html_url":"https://github.com/jhesketh","followers_url":"https://api.github.com/users/jhesketh/followers","following_url":"https://api.github.com/users/jhesketh/following{/other_user}","gists_url":"https://api.github.com/users/jhesketh/gists{/gist_id}","starred_url":"https://api.github.com/users/jhesketh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhesketh/subscriptions","organizations_url":"https://api.github.com/users/jhesketh/orgs","repos_url":"https://api.github.com/users/jhesketh/repos","events_url":"https://api.github.com/users/jhesketh/events{/privacy}","received_events_url":"https://api.github.com/users/jhesketh/received_events","type":"User","site_admin":false},"body":"This is to allow users to migrate from postgres to mariadb. It enables\r\nmultiple proposals for the database barclamp so that the deployer can\r\nchoose between migrating on the same node or over to a new node.\r\n\r\nThis assumes there are three scenarios:\r\n - 1 single instance of postgres is deployed (keep using in legacy)\r\n - 1 single instance of mariadb is deployed (migration finished)\r\n - 1 instance of each postgresql and mariadb is deployed. (In this case\r\npostgres is still used by the control plane until the migration is\r\ncomplete).\r\n\r\nTODO:\r\n - Handle deploying to a new node\r\n - Handle deploying postgres+HA and mariadb+galera\r\n - Handle the 2 node drdb case\r\n - Ensure/enforce only the above 3 scenarios are possible. ie, disallow\r\na second postgres to be deployed.\r\n\r\nThis code is kinda hacky but only intended as a temporary measure for\r\nthe migration in cloud 7. This should not be in cloud 8.\r\n","created_at":"2018-06-15T06:56:40Z","updated_at":"2018-06-15T06:56:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"098a40ee2a96744bc27d2dceee95d56f64f76bca","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/1685/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/01728fefe5e0508246dce124fe07ca69d2d38ef3","head":{"label":"jhesketh:dualdb4.0","ref":"dualdb4.0","sha":"01728fefe5e0508246dce124fe07ca69d2d38ef3","user":{"login":"jhesketh","id":728450,"node_id":"MDQ6VXNlcjcyODQ1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/728450?v=4","gravatar_id":"","url":"https://api.github.com/users/jhesketh","html_url":"https://github.com/jhesketh","followers_url":"https://api.github.com/users/jhesketh/followers","following_url":"https://api.github.com/users/jhesketh/following{/other_user}","gists_url":"https://api.github.com/users/jhesketh/gists{/gist_id}","starred_url":"https://api.github.com/users/jhesketh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhesketh/subscriptions","organizations_url":"https://api.github.com/users/jhesketh/orgs","repos_url":"https://api.github.com/users/jhesketh/repos","events_url":"https://api.github.com/users/jhesketh/events{/privacy}","received_events_url":"https://api.github.com/users/jhesketh/received_events","type":"User","site_admin":false},"repo":{"id":100338282,"node_id":"MDEwOlJlcG9zaXRvcnkxMDAzMzgyODI=","name":"crowbar-openstack","full_name":"jhesketh/crowbar-openstack","owner":{"login":"jhesketh","id":728450,"node_id":"MDQ6VXNlcjcyODQ1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/728450?v=4","gravatar_id":"","url":"https://api.github.com/users/jhesketh","html_url":"https://github.com/jhesketh","followers_url":"https://api.github.com/users/jhesketh/followers","following_url":"https://api.github.com/users/jhesketh/following{/other_user}","gists_url":"https://api.github.com/users/jhesketh/gists{/gist_id}","starred_url":"https://api.github.com/users/jhesketh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhesketh/subscriptions","organizations_url":"https://api.github.com/users/jhesketh/orgs","repos_url":"https://api.github.com/users/jhesketh/repos","events_url":"https://api.github.com/users/jhesketh/events{/privacy}","received_events_url":"https://api.github.com/users/jhesketh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhesketh/crowbar-openstack","description":"Openstack deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/jhesketh/crowbar-openstack","forks_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/releases{/id}","deployments_url":"https://api.github.com/repos/jhesketh/crowbar-openstack/deployments","created_at":"2017-08-15T04:21:51Z","updated_at":"2017-08-15T04:21:54Z","pushed_at":"2018-06-15T06:55:12Z","git_url":"git://github.com/jhesketh/crowbar-openstack.git","ssh_url":"git@github.com:jhesketh/crowbar-openstack.git","clone_url":"https://github.com/jhesketh/crowbar-openstack.git","svn_url":"https://github.com/jhesketh/crowbar-openstack","homepage":null,"size":20107,"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,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"crowbar:stable/4.0","ref":"stable/4.0","sha":"a2cb98bf36d050ab1ef1f4e37022a465e18403fb","user":{"login":"crowbar","id":2910205,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTAyMDU=","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":39006903,"node_id":"MDEwOlJlcG9zaXRvcnkzOTAwNjkwMw==","name":"crowbar-openstack","full_name":"crowbar/crowbar-openstack","owner":{"login":"crowbar","id":2910205,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTAyMDU=","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-openstack","description":"Openstack deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-openstack","forks_url":"https://api.github.com/repos/crowbar/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-openstack/releases{/id}","deployments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/deployments","created_at":"2015-07-13T10:55:33Z","updated_at":"2018-06-14T10:28:19Z","pushed_at":"2018-06-15T06:56:41Z","git_url":"git://github.com/crowbar/crowbar-openstack.git","ssh_url":"git@github.com:crowbar/crowbar-openstack.git","clone_url":"https://github.com/crowbar/crowbar-openstack.git","svn_url":"https://github.com/crowbar/crowbar-openstack","homepage":null,"size":21047,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":85,"mirror_url":null,"archived":false,"open_issues_count":76,"license":null,"forks":85,"open_issues":76,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/1685"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/1685"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/1685/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1685/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/01728fefe5e0508246dce124fe07ca69d2d38ef3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}