blob: 9a8e80f211cc691cc4bbf7fc5fcca0f92c1949b5 [file] [log] [blame]
Mike Trutya2e18532011-04-06 15:11:22 -07001# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
Simran Basiaf9b8e72012-10-12 15:02:36 -07004import logging, signal
Mike Trutya2e18532011-04-06 15:11:22 -07005
Simran Basiaf9b8e72012-10-12 15:02:36 -07006from autotest_lib.client.common_lib import error, utils
Mike Trutya2e18532011-04-06 15:11:22 -07007
8# Override default parser with our site parser.
9# This is coordinated with site_monitor_db.py.
10def check_parse(process_info):
11 return process_info['comm'] == 'site_parse'
Simran Basiaf9b8e72012-10-12 15:02:36 -070012
13
14class SiteDroneUtility(object):
15
16
17 def kill_processes(self, process_list):
18 signal_queue = (signal.SIGCONT, signal.SIGTERM, signal.SIGKILL)
19 try:
20 logging.info('List of process to be killed: %s', process_list)
21 utils.nuke_pids([process.pid for process in process_list],
22 signal_queue=signal_queue)
23 except error.AutoservRunError as e:
24 self._warn('Error occured when killing processes. Error: %s' % e)