OLD | NEW |
1 #!/usr/bin/python -u | 1 #!/usr/bin/python -u |
2 | 2 |
3 """ | 3 """ |
4 Autotest scheduler | 4 Autotest scheduler |
5 """ | 5 """ |
6 | 6 |
7 | 7 |
8 import common | 8 import common |
9 import datetime, errno, optparse, os, pwd, Queue, re, shutil, signal | 9 import datetime, errno, optparse, os, pwd, Queue, re, shutil, signal |
10 import smtplib, socket, stat, subprocess, sys, tempfile, time, traceback, urllib | 10 import smtplib, socket, stat, subprocess, sys, tempfile, time, traceback, urllib |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 # error message to leave in results dir when an autoserv process disappears | 46 # error message to leave in results dir when an autoserv process disappears |
47 # mysteriously | 47 # mysteriously |
48 _LOST_PROCESS_ERROR = """\ | 48 _LOST_PROCESS_ERROR = """\ |
49 Autoserv failed abnormally during execution for this job, probably due to a | 49 Autoserv failed abnormally during execution for this job, probably due to a |
50 system error on the Autotest server. Full results may not be available. Sorry. | 50 system error on the Autotest server. Full results may not be available. Sorry. |
51 """ | 51 """ |
52 | 52 |
53 _db = None | 53 _db = None |
54 _shutdown = False | 54 _shutdown = False |
55 _autoserv_path = os.path.join(drones.AUTOTEST_INSTALL_DIR, 'server', 'autoserv') | 55 _autoserv_path = os.path.join(drones.AUTOTEST_INSTALL_DIR, 'server', 'autoserv') |
56 _parser_path = os.path.join(drones.AUTOTEST_INSTALL_DIR, 'tko', 'parse') | |
57 _testing_mode = False | 56 _testing_mode = False |
58 _drone_manager = None | 57 _drone_manager = None |
59 | 58 |
| 59 def _parser_path_default(install_dir): |
| 60 return os.path.join(install_dir, 'tko', 'parse') |
| 61 _parser_path_func = utils.import_site_function( |
| 62 __file__, 'autotest_lib.scheduler.site_monitor_db', |
| 63 'parser_path', _parser_path_default) |
| 64 _parser_path = _parser_path_func(drones.AUTOTEST_INSTALL_DIR) |
| 65 |
60 | 66 |
61 def _get_pidfile_timeout_secs(): | 67 def _get_pidfile_timeout_secs(): |
62 """@returns How long to wait for autoserv to write pidfile.""" | 68 """@returns How long to wait for autoserv to write pidfile.""" |
63 pidfile_timeout_mins = global_config.global_config.get_config_value( | 69 pidfile_timeout_mins = global_config.global_config.get_config_value( |
64 scheduler_config.CONFIG_SECTION, 'pidfile_timeout_mins', type=int) | 70 scheduler_config.CONFIG_SECTION, 'pidfile_timeout_mins', type=int) |
65 return pidfile_timeout_mins * 60 | 71 return pidfile_timeout_mins * 60 |
66 | 72 |
67 | 73 |
68 def _site_init_monitor_db_dummy(): | 74 def _site_init_monitor_db_dummy(): |
69 return {} | 75 return {} |
(...skipping 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2592 paired_process = self._paired_with_monitor().get_process() | 2598 paired_process = self._paired_with_monitor().get_process() |
2593 _drone_manager.write_lines_to_file( | 2599 _drone_manager.write_lines_to_file( |
2594 failed_file, ['Archiving failed with exit code %s' | 2600 failed_file, ['Archiving failed with exit code %s' |
2595 % self.monitor.exit_code()], | 2601 % self.monitor.exit_code()], |
2596 paired_with_process=paired_process) | 2602 paired_with_process=paired_process) |
2597 self._set_all_statuses(self._final_status()) | 2603 self._set_all_statuses(self._final_status()) |
2598 | 2604 |
2599 | 2605 |
2600 if __name__ == '__main__': | 2606 if __name__ == '__main__': |
2601 main() | 2607 main() |
OLD | NEW |