- cmd = "ps -ef | grep -v grep | grep honeycomb"
- for node in nodes:
- if node['type'] == NodeType.DUT:
- try:
- status_code, _ = HTTPRequest.get(node, '/index.html',
- enable_logging=False)
- if status_code == HTTPCodes.OK:
- raise HoneycombError('Honeycomb on node {0} is still '
- 'running.'.format(node['host']),
- enable_logging=False)
- elif status_code == HTTPCodes.NOT_FOUND:
- raise HoneycombError('Honeycomb on node {0} is shutting'
- ' down.'.format(node['host']),
- enable_logging=False)
- else:
- raise HoneycombError('Unexpected return code: {0}.'.
- format(status_code))
- except HTTPRequestError:
- logger.debug('Connection refused, checking the process '
- 'state ...')
- ssh = SSH()
- ssh.connect(node)
- (ret_code, _, _) = ssh.exec_command_sudo(cmd)
- if ret_code == 0:
- raise HoneycombError('Honeycomb on node {0} is still '
- 'running.'.format(node['host']),
- enable_logging=False)
- else:
- logger.info("Honeycomb on node {0} has stopped".
- format(node['host']))
+ cmd = "pgrep honeycomb"
+
+ ssh = SSH()
+ ssh.connect(node)
+ (ret_code, _, _) = ssh.exec_command_sudo(cmd)
+ if ret_code == 0:
+ raise HoneycombError('Honeycomb on node {0} is still '
+ 'running.'.format(node['host']),
+ enable_logging=False)
+ else:
+ logger.info("Honeycomb on node {0} has stopped".
+ format(node['host']))