summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2014-11-15 20:25:44 +0100
committerJan Lehnardt <jan@apache.org>2014-11-15 20:25:44 +0100
commit9c3eb0a1a332195a1e4f8e85a368bbc8a36469eb (patch)
tree397792ed9c7d958fa856e8acceb7ade30b6697d6
parent14e0374429b654e0779e7c0c7dd739289728e682 (diff)
downloadcouchdb-9c3eb0a1a332195a1e4f8e85a368bbc8a36469eb.tar.gz
show cluster finished state
-rw-r--r--src/setup.erl4
-rw-r--r--src/setup_httpd.erl7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/setup.erl b/src/setup.erl
index 29576b2fa..c5a38ea2b 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.
diff --git a/src/setup_httpd.erl b/src/setup_httpd.erl
index bdb33123d..aca98e7e5 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) ->