Permalink
Browse files

graceful return for bucket-create error

  • Loading branch information...
1 parent bd7c3be commit dac6576d5666643d50e71d83f1c94c58c43d9fa3 @ronniedada ronniedada committed Dec 28, 2012
Showing with 15 additions and 11 deletions.
  1. +15 −11 cookbooks/couchbase/recipes/setup-2.0.0.rb
@@ -85,17 +85,21 @@
" --bucket-type=couchbase" +
" --bucket-ramsize=#{node[:db_couchbase][:bucket][:ram]}" +
" --bucket-replica=#{node[:db_couchbase][:bucket][:replica]}")
-execute "creating bucket: #{node[:db_couchbase][:bucket][:name]}" do
- command("sleep 10 && /opt/couchbase/bin/couchbase-cli bucket-create" +
- " -c 127.0.0.1:8091" +
- " -u #{node[:db_couchbase][:cluster][:username]}" +
- " -p #{node[:db_couchbase][:cluster][:password]}" +
- " --bucket=#{node[:db_couchbase][:bucket][:name]}" +
- " --bucket-type=couchbase" +
- " --bucket-password=\"#{node[:db_couchbase][:bucket][:password]}\"" +
- " --bucket-ramsize=#{node[:db_couchbase][:bucket][:ram]}" +
- " --bucket-replica=#{node[:db_couchbase][:bucket][:replica]}")
- action :run
+begin
+ execute "creating bucket: #{node[:db_couchbase][:bucket][:name]}" do
+ command("sleep 10 && /opt/couchbase/bin/couchbase-cli bucket-create" +
+ " -c 127.0.0.1:8091" +
+ " -u #{node[:db_couchbase][:cluster][:username]}" +
+ " -p #{node[:db_couchbase][:cluster][:password]}" +
+ " --bucket=#{node[:db_couchbase][:bucket][:name]}" +
+ " --bucket-type=couchbase" +
+ " --bucket-password=\"#{node[:db_couchbase][:bucket][:password]}\"" +
+ " --bucket-ramsize=#{node[:db_couchbase][:bucket][:ram]}" +
+ " --bucket-replica=#{node[:db_couchbase][:bucket][:replica]}")
+ action :run
+ end
+rescue Exception => e
+ log e
end
cluster_tag = node[:db_couchbase][:cluster][:tag]

0 comments on commit dac6576

Please sign in to comment.