summaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorFuss, Areli (af732p) <af732p@intl.att.com>2020-05-14 15:27:12 +0300
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-05-17 07:26:58 +0000
commita532a8c241439ee774326068137e6b5cbb8f348f (patch)
treec68f8d046716d3ae4a0fd1473becbada319f9ebb /catalog-be
parent8a6289f745fd37afcad9d0a15a6666c50fb46aef (diff)
sdc-backend-init does not restart on healthcheck failure
Issue-ID: SDC-3063 Change-Id: I6c4a796f42060832ee8a37a708dedda7e7e98c70 Signed-off-by: Fuss, Areli (af732p) <areli.fuss@intl.att.com>
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb1
-rw-r--r--catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/templates/default/check_Backend_Health.py.erb3
2 files changed, 3 insertions, 1 deletions
diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
index 0a551f2a52..cd36fbd26b 100644
--- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
+++ b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
@@ -23,4 +23,5 @@ bash "executing-check_Backend_Health" do
rc=$?
if [[ $rc != 0 ]]; then exit $rc; fi
EOH
+ returns [0]
end \ No newline at end of file
diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/templates/default/check_Backend_Health.py.erb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/templates/default/check_Backend_Health.py.erb
index eb77f93c33..bcacf888ed 100644
--- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/templates/default/check_Backend_Health.py.erb
+++ b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/templates/default/check_Backend_Health.py.erb
@@ -3,6 +3,7 @@ import subprocess
#from time import sleep
import time
from datetime import datetime
+import sys
beStat=0
BE_IP="<%= @be_ip %>"
@@ -48,4 +49,4 @@ for i in range(1,10):
if beStat == 0:
print '[ERROR]: ' + time.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + 'Backend is DOWN :-(' + bcolors.ENDC
- exit() \ No newline at end of file
+ sys.exit(1) \ No newline at end of file