couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject couchdb-setup git commit: show cluster finished state
Date Sat, 15 Nov 2014 19:27:11 GMT
Repository: couchdb-setup
Updated Branches:
  refs/heads/master 14e037442 -> 9c3eb0a1a


show cluster finished state


Project: http://git-wip-us.apache.org/repos/asf/couchdb-setup/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-setup/commit/9c3eb0a1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-setup/tree/9c3eb0a1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-setup/diff/9c3eb0a1

Branch: refs/heads/master
Commit: 9c3eb0a1a332195a1e4f8e85a368bbc8a36469eb
Parents: 14e0374
Author: Jan Lehnardt <jan@apache.org>
Authored: Sat Nov 15 20:25:44 2014 +0100
Committer: Jan Lehnardt <jan@apache.org>
Committed: Sat Nov 15 20:25:44 2014 +0100

----------------------------------------------------------------------
 src/setup.erl       | 4 ++--
 src/setup_httpd.erl | 7 ++++++-
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/9c3eb0a1/src/setup.erl
----------------------------------------------------------------------
diff --git a/src/setup.erl b/src/setup.erl
index 29576b2..c5a38ea 100644
--- a/src/setup.erl
+++ b/src/setup.erl
@@ -13,7 +13,7 @@
 -module(setup).
 
 -export([enable_cluster/1, finish_cluster/0, add_node/1, receive_cookie/1]).
--export([is_cluster_enabled/0]).
+-export([is_cluster_enabled/0, has_cluster_system_dbs/0]).
 
 -include_lib("../couch/include/couch_db.hrl").
 
@@ -51,7 +51,7 @@ has_cluster_system_dbs() ->
     case catch {
     fabric:get_db_info("_users"),
     fabric:get_db_info("_replicator"),
-    fabric:get_db_info("_cassim")} of
+    fabric:get_db_info("cassim")} of
         {{ok, _}, {ok, _}, {ok, _}} -> ok;
         _ -> no
     end.

http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/9c3eb0a1/src/setup_httpd.erl
----------------------------------------------------------------------
diff --git a/src/setup_httpd.erl b/src/setup_httpd.erl
index bdb3312..aca98e7 100644
--- a/src/setup_httpd.erl
+++ b/src/setup_httpd.erl
@@ -33,7 +33,12 @@ handle_setup_req(#httpd{method='GET'}=Req) ->
         no ->
             chttpd:send_json(Req, 201, {[{state, cluster_disabled}]});
         ok ->
-            chttpd:send_json(Req, 201, {[{state, cluster_enabled}]})
+            case setup:has_cluster_system_dbs() of
+                no ->
+                    chttpd:send_json(Req, 201, {[{state, cluster_enabled}]});
+                ok ->
+                    chttpd:send_json(Req, 201, {[{state, cluster_finished}]})
+            end
     end.
 
 get_options(Options, Setup) ->


Mime
View raw message