From 80c79ec9da699b751d4420233e602fa6ab36e1d2 Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Tue, 11 Jul 2017 16:07:56 +0200
Subject: [PATCH] stack/caucase: Disable always failing promise

 The principle of deployment on slapos is once the instance is read to use the
 all the promises must work and buildout would stop to run for a while. This
 Promise is been disable because it assumes the user must use the instance first
 them the promise will be green, which can cause endless failure.

 This fail until user do something makes tests and resilience fail, as there is
 no automation to emulate a user take some action.

 This problem MUST be reimplemented on the current way, and not assume user will
 do any action. Others promises can be added into monitor (but not this one like this).
---
 stack/caucase/buildout.hash.cfg              |  2 +-
 stack/caucase/instance-caucase.cfg.jinja2.in | 25 ++++++++++++--------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/stack/caucase/buildout.hash.cfg b/stack/caucase/buildout.hash.cfg
index c7bc0848f..34da2fa67 100644
--- a/stack/caucase/buildout.hash.cfg
+++ b/stack/caucase/buildout.hash.cfg
@@ -28,7 +28,7 @@ md5sum = a317d2f948cd3d16c860d05cc07ecf42
 
 [template-caucase]
 filename = instance-caucase.cfg.jinja2.in
-md5sum = b801dfe4212ff97dc29191e4610df3a3
+md5sum = 1988d9c98c2331f49335a1b9a4c26026
 
 [instance-caucase]
 filename = instance.cfg.in
diff --git a/stack/caucase/instance-caucase.cfg.jinja2.in b/stack/caucase/instance-caucase.cfg.jinja2.in
index 33251ef58..febd9b04f 100644
--- a/stack/caucase/instance-caucase.cfg.jinja2.in
+++ b/stack/caucase/instance-caucase.cfg.jinja2.in
@@ -163,12 +163,14 @@ url = https://[${ca-parameters:ipv6}]:${ca-parameters:server-https-port}
 http-url = ${ca-parameters:crl-external-url}
 depends = 
   ${nginx-certificate-request:wrapper-path}
-  ${caucase-server-promise:filename}
   ${caucase-https-server-promise:filename}
   ${ca-nginx-graceful:output}
   ${ca-certificate-renew-cron-entry:name}
   ${logrotate-ca-nginx:name}
 
+# Disabled to be re-implemented.
+#  ${caucase-server-promise:filename}
+
 [ca-certificate-renew-cron-entry]
 recipe = slapos.cookbook:cron.d
 cron-entries = ${cron:cron-entries}
@@ -184,14 +186,17 @@ name = caucase-nginx-server
 log = ${ca-nginx-conf-parameter:access-log} ${ca-nginx-conf-parameter:access-log}
 post = {{ slapos_kill_bin }} --pidfile ${ca-nginx-conf-parameter:pid-file} -s USR1
 
-[caucase-server-promise]
-recipe = slapos.cookbook:check_url_available
-path = ${directory:promises}/${:filename}
-filename = caucase-server-listening-on-tcp
-url = http://[${ca-parameters:ipv6}]:${ca-parameters:server-port}
-dash_path = {{ dash_executable_location }}
-curl_path = {{ curl_executable_location }}
-
+# This promise is disabled as it requires user to take action so the buildout
+# will fail for way too long, and overload master. Please reimplement on a 
+# better way
+#[caucase-server-promise]
+#recipe = slapos.cookbook:check_url_available
+#path = ${directory:promises}/${:filename}
+#filename = caucase-server-listening-on-tcp
+#url = http://[${ca-parameters:ipv6}]:${ca-parameters:server-port}
+#dash_path = {{ dash_executable_location }}
+#curl_path = {{ curl_executable_location }}
+#
 [caucase-https-server-promise]
 recipe = slapos.cookbook:check_url_available
 path = ${directory:promises}/${:filename}
@@ -221,4 +226,4 @@ parts =
 
 eggs-directory = {{ eggs_directory }}
 develop-eggs-directory = {{ develop_eggs_directory }}
-offline = true
\ No newline at end of file
+offline = true
-- 
2.30.9