{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/59953915","id":59953915,"diff_hunk":"@@ -0,0 +1,82 @@\n+#\n+# Copyright 2016 SUSE Linux GmbH\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+# Cookbook Name:: magnum\n+# Recipe:: sql\n+#\n+\n+ha_enabled = node[:magnum][:ha][:enabled]\n+\n+db_settings = fetch_database_settings\n+include_recipe \"database::client\"\n+include_recipe \"#{db_settings[:backend_name]}::client\"\n+include_recipe \"#{db_settings[:backend_name]}::python-client\"\n+\n+crowbar_pacemaker_sync_mark \"wait-magnum_database\"\n+\n+# Create the Magnum Database\n+database \"create #{node[:magnum][:db][:database]} database\" do\n+  connection db_settings[:connection]\n+  database_name node[:magnum][:db][:database]\n+  provider db_settings[:provider]\n+  action :create\n+  only_if { !ha_enabled || CrowbarPacemakerHelper.is_cluster_founder?(node) }\n+end\n+\n+database_user \"create magnum database user\" do\n+  host \"%\"\n+  connection db_settings[:connection]\n+  username node[:magnum][:db][:user]\n+  password node[:magnum][:db][:password]\n+  provider db_settings[:user_provider]\n+  action :create\n+  only_if { !ha_enabled || CrowbarPacemakerHelper.is_cluster_founder?(node) }\n+end\n+\n+database_user \"grant database access for magnum database user\" do\n+  connection db_settings[:connection]\n+  username node[:magnum][:db][:user]\n+  password node[:magnum][:db][:password]\n+  database_name node[:magnum][:db][:database]\n+  host \"%\"\n+  privileges db_settings[:privs]\n+  provider db_settings[:user_provider]\n+  action :grant\n+  only_if { !ha_enabled || CrowbarPacemakerHelper.is_cluster_founder?(node) }\n+end\n+\n+execute \"magnum-manage db sync\" do\n+  command \"magnum-db-manage upgrade\"\n+  user node[:magnum][:user]\n+  group node[:magnum][:group]\n+  # We only do the sync the first time, and only if we're not doing HA or if we\n+  # are the founder of the HA cluster (so that it's really only done once).\n+  only_if { !node[:magnum][:db_synced] && (!ha_enabled || CrowbarPacemakerHelper.is_cluster_founder?(node)) }","path":"chef/cookbooks/magnum/recipes/sql.rb","position":66,"original_position":66,"commit_id":"2ede5b84ddff715f9ffdb2467aa23c6af960f1cb","original_commit_id":"2ede5b84ddff715f9ffdb2467aa23c6af960f1cb","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.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":"Metrics/LineLength: Line is too long. [109/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)","created_at":"2016-04-15T23:19:26Z","updated_at":"2016-04-15T23:19:26Z","html_url":"https://github.com/crowbar/crowbar-openstack/pull/360#discussion_r59953915","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/360","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/59953915"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/360#discussion_r59953915"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/360"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/360","id":66717522,"html_url":"https://github.com/crowbar/crowbar-openstack/pull/360","diff_url":"https://github.com/crowbar/crowbar-openstack/pull/360.diff","patch_url":"https://github.com/crowbar/crowbar-openstack/pull/360.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/360","number":360,"state":"open","locked":false,"title":"[UNTESTED] Initial Barclamp to deploy magnum","user":{"login":"mmnelemane","id":13483069,"avatar_url":"https://avatars.githubusercontent.com/u/13483069?v=3","gravatar_id":"","url":"https://api.github.com/users/mmnelemane","html_url":"https://github.com/mmnelemane","followers_url":"https://api.github.com/users/mmnelemane/followers","following_url":"https://api.github.com/users/mmnelemane/following{/other_user}","gists_url":"https://api.github.com/users/mmnelemane/gists{/gist_id}","starred_url":"https://api.github.com/users/mmnelemane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmnelemane/subscriptions","organizations_url":"https://api.github.com/users/mmnelemane/orgs","repos_url":"https://api.github.com/users/mmnelemane/repos","events_url":"https://api.github.com/users/mmnelemane/events{/privacy}","received_events_url":"https://api.github.com/users/mmnelemane/received_events","type":"User","site_admin":false},"body":"The barclamp is used to deploy magnum with SOC with basic features. It uses default Fedora Service image for container service. ","created_at":"2016-04-15T23:19:20Z","updated_at":"2016-04-15T23:19:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"947d4965fea2aab5399d1b4329926afc93dc7199","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/360/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/360/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/360/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/2ede5b84ddff715f9ffdb2467aa23c6af960f1cb","head":{"label":"mmnelemane:magnum_bc","ref":"magnum_bc","sha":"2ede5b84ddff715f9ffdb2467aa23c6af960f1cb","user":{"login":"mmnelemane","id":13483069,"avatar_url":"https://avatars.githubusercontent.com/u/13483069?v=3","gravatar_id":"","url":"https://api.github.com/users/mmnelemane","html_url":"https://github.com/mmnelemane","followers_url":"https://api.github.com/users/mmnelemane/followers","following_url":"https://api.github.com/users/mmnelemane/following{/other_user}","gists_url":"https://api.github.com/users/mmnelemane/gists{/gist_id}","starred_url":"https://api.github.com/users/mmnelemane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmnelemane/subscriptions","organizations_url":"https://api.github.com/users/mmnelemane/orgs","repos_url":"https://api.github.com/users/mmnelemane/repos","events_url":"https://api.github.com/users/mmnelemane/events{/privacy}","received_events_url":"https://api.github.com/users/mmnelemane/received_events","type":"User","site_admin":false},"repo":{"id":45601858,"name":"crowbar-openstack","full_name":"mmnelemane/crowbar-openstack","owner":{"login":"mmnelemane","id":13483069,"avatar_url":"https://avatars.githubusercontent.com/u/13483069?v=3","gravatar_id":"","url":"https://api.github.com/users/mmnelemane","html_url":"https://github.com/mmnelemane","followers_url":"https://api.github.com/users/mmnelemane/followers","following_url":"https://api.github.com/users/mmnelemane/following{/other_user}","gists_url":"https://api.github.com/users/mmnelemane/gists{/gist_id}","starred_url":"https://api.github.com/users/mmnelemane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmnelemane/subscriptions","organizations_url":"https://api.github.com/users/mmnelemane/orgs","repos_url":"https://api.github.com/users/mmnelemane/repos","events_url":"https://api.github.com/users/mmnelemane/events{/privacy}","received_events_url":"https://api.github.com/users/mmnelemane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmnelemane/crowbar-openstack","description":"Openstack deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/mmnelemane/crowbar-openstack","forks_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/releases{/id}","deployments_url":"https://api.github.com/repos/mmnelemane/crowbar-openstack/deployments","created_at":"2015-11-05T09:43:10Z","updated_at":"2016-01-20T16:50:50Z","pushed_at":"2016-04-15T21:50:14Z","git_url":"git://github.com/mmnelemane/crowbar-openstack.git","ssh_url":"git@github.com:mmnelemane/crowbar-openstack.git","clone_url":"https://github.com/mmnelemane/crowbar-openstack.git","svn_url":"https://github.com/mmnelemane/crowbar-openstack","homepage":null,"size":16598,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"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":"43960a56c2ec8d089605e96fd1132199d65792e3","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.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":39006903,"name":"crowbar-openstack","full_name":"crowbar/crowbar-openstack","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.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-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":"2016-01-11T12:29:07Z","pushed_at":"2016-04-15T23:19:20Z","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":16846,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":23,"forks":23,"open_issues":23,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/360"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/360"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/360"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/360/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/360/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/360/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/2ede5b84ddff715f9ffdb2467aa23c6af960f1cb"}}}}