Permalink
Browse files

[db_mysql] * Set read_only flag to 0 in action :reset.

* Rename db_mysql_set_mycnf_read_only definition to db_mysql_set_mysql_read_only.
  • Loading branch information...
nitinmohan87 committed Dec 5, 2012
1 parent f068519 commit 54f3fa7fc45d45add6107ded7f18b33d41b55cd1
@@ -5,7 +5,7 @@
# RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
-define :db_mysql_set_mycnf_read_only, :read_only => false do
+define :db_mysql_set_mysql_read_only, :read_only => false do
read_only = params[:read_only] ? 1 : 0
log " Installing read_write_status.cnf with read_only = #{read_only}"
@@ -64,8 +64,13 @@
end
action :reset do
+ # Set read/write in read_write_status.cnf
+ db_mysql_set_mysql_read_only "setup_mysql_read_only" do
+ read_only false
+ end
+
# See cookbooks/db_mysql/libraries/helper.rb for the "init" method.
-# See "rightscale_tools" gem for the "reset" method.
+ # See "rightscale_tools" gem for the "reset" method.
@db = init(new_resource)
@db.reset(new_resource.name, node[:db_mysql][:datadir])
end
@@ -423,7 +428,7 @@
end
# Setup read_write_status.cnf
- db_mysql_set_mycnf_read_only "setup_mycnf_read_only" do
+ db_mysql_set_mysql_read_only "setup_mysql_read_only" do
read_only false
end
@@ -630,7 +635,7 @@
end
# Set read/write in read_write_status.cnf
- db_mysql_set_mycnf_read_only "setup_mycnf_read_only" do
+ db_mysql_set_mysql_read_only "setup_mysql_read_only" do
read_only false
end
@@ -836,7 +841,7 @@
end
# Set read_only in read_write_status.cnf
- db_mysql_set_mycnf_read_only "setup_mycnf_read_only" do
+ db_mysql_set_mysql_read_only "setup_mysql_read_only" do
read_only true
end

0 comments on commit 54f3fa7

Please sign in to comment.