{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/216015643","pull_request_review_id":153414364,"id":216015643,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjAxNTY0Mw==","diff_hunk":"@@ -0,0 +1,52 @@\n+def upgrade(ta, td, a, d)\n+  # Up to now the db passwords were store only in the proposal-role not in the\n+  # proposal itself. So we need to initialize the proposal values from the\n+  # proposal role.\n+  role_name = d['config']['environment']\n+  role = Chef::Role.load(role_name) rescue nil\n+\n+  service = ServiceObject.new \"fake-logger\"\n+  if role.nil?\n+    # role.nil? means a proposal exists but it hasn't been applied yet. In\n+    # this case we need to create new random passwords.\n+\n+    # In case this migration gets backported we need to avoid overwriting\n+    # existing passwords\n+    a[\"db_maker_password\"] ||= service.random_password\n+    a[\"mysql\"][\"server_root_password\"] ||= service.random_password\n+    a[\"mysql\"][\"sstuser_password\"] ||= service.random_password\n+    a[\"postgresql\"][\"password\"][\"postgres\"] ||= service.random_password\n+  else\n+    # The existing proposal as been applied at least once, copy the\n+    # passwords from the propsal role into the proposal\n+    # Note: This migration will also be execute on the proposal\n+    # role itself. But that shouldn't be any problem, since we'd just\n+    # copy the values from the same role.\n+\n+    a[\"db_maker_password\"] ||= role.default_attributes[\"database\"][\"db_maker_password\"]\n+    a[\"mysql\"][\"server_root_password\"] ||=\n+      role.default_attributes[\"database\"][\"mysql\"][\"server_root_password\"]\n+\n+    # This wasn't set for non-HA deployments in the past. Just create a new\n+    # random password to avoid future confusion, as we now create a random\n+    # password in the proposal as well.\n+    a[\"mysql\"][\"sstuser_password\"] ||=\n+      role.default_attributes[\"database\"][\"mysql\"][\"sstuser_password\"] || service.random_password\n+\n+    # The postgresql password is store in an override_attribute before\n+    # this migration. In case postgresql was not deployed the password is empty\n+    # We just generate a random one as the proposal create also generates one\n+    # independent of the choice of the deployed db backend\n+    a[\"postgresql\"][\"password\"] ||= {}\n+    a[\"postgresql\"][\"password\"][\"postgres\"] ||=\n+      role.override_attributes[\"database\"][\"postgresql\"][\"password\"][\"postgres\"] rescue nil || service.random_password","path":"chef/data_bags/crowbar/migrate/database/301_passwords_in_proposal.rb","position":42,"original_position":42,"commit_id":"c184063ca8711b52ef8c8fb5d271b6fa2e5d415a","original_commit_id":"c184063ca8711b52ef8c8fb5d271b6fa2e5d415a","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":"Metrics/LineLength: Line is too long. [118/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)","created_at":"2018-09-07T16:27:10Z","updated_at":"2018-09-07T16:27:11Z","html_url":"https://github.com/crowbar/crowbar-openstack/pull/1760#discussion_r216015643","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1760","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/216015643"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/1760#discussion_r216015643"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1760"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1760","id":213644448,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNjQ0NDQ4","html_url":"https://github.com/crowbar/crowbar-openstack/pull/1760","diff_url":"https://github.com/crowbar/crowbar-openstack/pull/1760.diff","patch_url":"https://github.com/crowbar/crowbar-openstack/pull/1760.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/1760","number":1760,"state":"open","locked":false,"title":"database: keep the sst passwort in the proposal","user":{"login":"dirkmueller","id":1029152,"node_id":"MDQ6VXNlcjEwMjkxNTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1029152?v=4","gravatar_id":"","url":"https://api.github.com/users/dirkmueller","html_url":"https://github.com/dirkmueller","followers_url":"https://api.github.com/users/dirkmueller/followers","following_url":"https://api.github.com/users/dirkmueller/following{/other_user}","gists_url":"https://api.github.com/users/dirkmueller/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkmueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkmueller/subscriptions","organizations_url":"https://api.github.com/users/dirkmueller/orgs","repos_url":"https://api.github.com/users/dirkmueller/repos","events_url":"https://api.github.com/users/dirkmueller/events{/privacy}","received_events_url":"https://api.github.com/users/dirkmueller/received_events","type":"User","site_admin":false},"body":"When you enable/disable HA on the database proposal in your\r\nexisting deployment, the sstuser_password wasn't stored\r\nand on reenable was reset to \"random_password\", which broke\r\nIST/SST of the existing cluster, so an inconsistent cluster was\r\nnot recoverable without manual intervention. Always keep\r\nthe password that was previously set, even if we switch to\r\nnon-HA.","created_at":"2018-09-06T14:44:17Z","updated_at":"2018-09-07T16:27:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbcd603e1f58d1701589d3a5f2dcd4c710f7a5d0","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rhafer","id":373399,"node_id":"MDQ6VXNlcjM3MzM5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/373399?v=4","gravatar_id":"","url":"https://api.github.com/users/rhafer","html_url":"https://github.com/rhafer","followers_url":"https://api.github.com/users/rhafer/followers","following_url":"https://api.github.com/users/rhafer/following{/other_user}","gists_url":"https://api.github.com/users/rhafer/gists{/gist_id}","starred_url":"https://api.github.com/users/rhafer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhafer/subscriptions","organizations_url":"https://api.github.com/users/rhafer/orgs","repos_url":"https://api.github.com/users/rhafer/repos","events_url":"https://api.github.com/users/rhafer/events{/privacy}","received_events_url":"https://api.github.com/users/rhafer/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":235648550,"node_id":"MDU6TGFiZWwyMzU2NDg1NTA=","url":"https://api.github.com/repos/crowbar/crowbar-openstack/labels/bug","name":"bug","color":"fc2929","default":true},{"id":711258318,"node_id":"MDU6TGFiZWw3MTEyNTgzMTg=","url":"https://api.github.com/repos/crowbar/crowbar-openstack/labels/needs%20backport%20to%20SOC7","name":"needs backport to SOC7","color":"0052cc","default":false},{"id":998466110,"node_id":"MDU6TGFiZWw5OTg0NjYxMTA=","url":"https://api.github.com/repos/crowbar/crowbar-openstack/labels/needs%20backport%20to%20SOC8","name":"needs backport to SOC8","color":"0052cc","default":false},{"id":264031316,"node_id":"MDU6TGFiZWwyNjQwMzEzMTY=","url":"https://api.github.com/repos/crowbar/crowbar-openstack/labels/wip","name":"wip","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1760/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1760/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/1760/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/c184063ca8711b52ef8c8fb5d271b6fa2e5d415a","head":{"label":"dirkmueller:galera_sst_pw","ref":"galera_sst_pw","sha":"c184063ca8711b52ef8c8fb5d271b6fa2e5d415a","user":{"login":"dirkmueller","id":1029152,"node_id":"MDQ6VXNlcjEwMjkxNTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1029152?v=4","gravatar_id":"","url":"https://api.github.com/users/dirkmueller","html_url":"https://github.com/dirkmueller","followers_url":"https://api.github.com/users/dirkmueller/followers","following_url":"https://api.github.com/users/dirkmueller/following{/other_user}","gists_url":"https://api.github.com/users/dirkmueller/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkmueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkmueller/subscriptions","organizations_url":"https://api.github.com/users/dirkmueller/orgs","repos_url":"https://api.github.com/users/dirkmueller/repos","events_url":"https://api.github.com/users/dirkmueller/events{/privacy}","received_events_url":"https://api.github.com/users/dirkmueller/received_events","type":"User","site_admin":false},"repo":{"id":41291687,"node_id":"MDEwOlJlcG9zaXRvcnk0MTI5MTY4Nw==","name":"crowbar-openstack","full_name":"dirkmueller/crowbar-openstack","owner":{"login":"dirkmueller","id":1029152,"node_id":"MDQ6VXNlcjEwMjkxNTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1029152?v=4","gravatar_id":"","url":"https://api.github.com/users/dirkmueller","html_url":"https://github.com/dirkmueller","followers_url":"https://api.github.com/users/dirkmueller/followers","following_url":"https://api.github.com/users/dirkmueller/following{/other_user}","gists_url":"https://api.github.com/users/dirkmueller/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkmueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkmueller/subscriptions","organizations_url":"https://api.github.com/users/dirkmueller/orgs","repos_url":"https://api.github.com/users/dirkmueller/repos","events_url":"https://api.github.com/users/dirkmueller/events{/privacy}","received_events_url":"https://api.github.com/users/dirkmueller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dirkmueller/crowbar-openstack","description":"Openstack deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/dirkmueller/crowbar-openstack","forks_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/releases{/id}","deployments_url":"https://api.github.com/repos/dirkmueller/crowbar-openstack/deployments","created_at":"2015-08-24T08:33:53Z","updated_at":"2018-04-06T20:28:19Z","pushed_at":"2018-09-07T16:26:57Z","git_url":"git://github.com/dirkmueller/crowbar-openstack.git","ssh_url":"git@github.com:dirkmueller/crowbar-openstack.git","clone_url":"https://github.com/dirkmueller/crowbar-openstack.git","svn_url":"https://github.com/dirkmueller/crowbar-openstack","homepage":null,"size":21240,"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:master","ref":"master","sha":"5f47b88f61623e273ae7d2eb390dc05aae4fb1b4","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-09-07T06:04:12Z","pushed_at":"2018-09-07T16:26:58Z","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":21204,"stargazers_count":17,"watchers_count":17,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":83,"mirror_url":null,"archived":false,"open_issues_count":96,"license":null,"forks":83,"open_issues":96,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1760"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/1760"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/1760"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/1760/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/1760/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/1760/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/c184063ca8711b52ef8c8fb5d271b6fa2e5d415a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}