Skip to content

Commit ff92bfa

Browse files
authored
Merge pull request HariSekhon#5 from jaysensharma/Zookeeper_Service_Check_Branch
Zookeeper service check fix.\n Command name is ZOOKEEPER_QUORUM_SERVI…
2 parents 865849e + 7353b56 commit ff92bfa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ambari_trigger_service_checks.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,22 @@ def gen_payload(self, services=None):
356356
for index in range(service_count):
357357
service = services[index]
358358
index += 1
359+
360+
commandData = ""
361+
if service.upper() == "ZOOKEEPER" :
362+
# this if block is needed because the ZOOKEEPRR service check command name is "ZOOKEEPER_QUORUM_SERVICE_CHECK" and not "ZOOKEEPER_SERVICE_CHECK"
363+
commandData = "{service}_QUORUM_SERVICE_CHECK".format(service=service.upper())
364+
else :
365+
commandData = "{service}_SERVICE_CHECK".format(service=service.upper())
366+
359367
payload[0]['RequestSchedule']['batch'][0]['requests'].append(
360368
{
361369
"order_id": index,
362370
"type": "POST",
363371
"uri": "/api/v1/clusters/{0}/requests".format(self.cluster),
364372
"RequestBodyInfo":{
365373
"RequestInfo": {
366-
"command": "{service}_SERVICE_CHECK".format(service=service.upper()),
374+
"command": "{commandData}".format(commandData=commandData) ,
367375
"context": "{service} Service Check (batch {index} of {total})".
368376
format(service=service, index=index, total=service_count)
369377
},

0 commit comments

Comments
 (0)