Refactoring the sdc-BE-init python scripts
[sdc.git] / catalog-be / sdc-backend-init / chef-repo / cookbooks / sdc-catalog-be-setup / templates / default / check_Backend_Health.py.erb
index bcacf88..ebd8ea5 100644 (file)
@@ -30,7 +30,7 @@ def checkBackend():
     proc = subprocess.Popen( command , shell=True , stdout=subprocess.PIPE )
     (out, err) = proc.communicate()
     result = out.strip()
-    return result
+    return str(result, "UTF-8")
 
 ##############################
 #    Main
@@ -39,12 +39,12 @@ def checkBackend():
 for i in range(1,10):
     myResult = checkBackend()
     if myResult == '200':
-        print '[INFO]: Backend is up and running'
+        print('[INFO]: Backend is up and running')
         beStat=1
         break
     else:
         currentTime = datetime.now()
-        print '[ERROR]: ' + currentTime.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + ' Backend not responding, try #' + str(i) + bcolors.ENDC
+        print('[ERROR]: ' + currentTime.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + ' Backend not responding, try #' + str(i) + bcolors.ENDC)
         time.sleep(10)
 
 if beStat == 0: