aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/resources/scripts/sdcBePy/common/healthCheck.py
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/resources/scripts/sdcBePy/common/healthCheck.py')
-rw-r--r--catalog-be/src/main/resources/scripts/sdcBePy/common/healthCheck.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/common/healthCheck.py b/catalog-be/src/main/resources/scripts/sdcBePy/common/healthCheck.py
index c99db5b434..a0acc90d44 100644
--- a/catalog-be/src/main/resources/scripts/sdcBePy/common/healthCheck.py
+++ b/catalog-be/src/main/resources/scripts/sdcBePy/common/healthCheck.py
@@ -12,9 +12,9 @@ from sdcBePy.common.sdcBeProxy import SdcBeProxy
colors = BColors()
-def check_backend(sdc_be_proxy=None, reply_append_count=1, be_host=None, be_port=None, scheme=None, debug=False):
+def check_backend(sdc_be_proxy=None, reply_append_count=1, be_host=None, be_port=None, header=None, scheme=None, debug=False):
if sdc_be_proxy is None:
- sdc_be_proxy = SdcBeProxy(be_host, be_port, scheme, debug=debug)
+ sdc_be_proxy = SdcBeProxy(be_host, be_port, header, scheme, debug=debug)
for i in range(1, reply_append_count + 1):
if sdc_be_proxy.check_backend() == 200:
@@ -28,9 +28,9 @@ def check_backend(sdc_be_proxy=None, reply_append_count=1, be_host=None, be_port
return False
-def run(be_host, be_port, protocol):
+def run(be_host, be_port, header, protocol):
if not check_backend(reply_append_count=properties.retry_attempts, be_host=be_host,
- be_port=be_port, scheme=protocol):
+ be_port=be_port, header=header, scheme=protocol):
print('[ERROR]: ' + time.strftime('%Y/%m/%d %H:%M:%S') + colors.FAIL + ' Backend is DOWN :-(' + colors.END_C)
sys.exit()
@@ -40,12 +40,13 @@ def get_args():
parser.add_argument('-i', '--ip', required=True)
parser.add_argument('-p', '--port', required=True)
+ parser.add_argument('--header')
parser.add_argument('--https', action='store_true')
args = parser.parse_args()
init_properties(10, 10)
- return [args.ip, args.port, 'https' if args.https else 'http']
+ return [args.ip, args.port, args.header, 'https' if args.https else 'http']
def main():