OLD | NEW |
1 import common | 1 import common |
2 from autotest_lib.client.common_lib import global_config | 2 from autotest_lib.client.common_lib import global_config |
3 | 3 |
4 CONFIG_SECTION = 'SCHEDULER' | 4 CONFIG_SECTION = 'SCHEDULER' |
5 | 5 |
6 class SchedulerConfig(object): | 6 class SchedulerConfig(object): |
7 """ | 7 """ |
8 Contains configuration that can be changed during scheduler execution. | 8 Contains configuration that can be changed during scheduler execution. |
9 """ | 9 """ |
10 FIELDS = {'max_processes_per_drone': 'max_processes_per_drone', | 10 FIELDS = {'max_processes_per_drone': 'max_processes_per_drone', |
11 'max_processes_started_per_cycle': 'max_jobs_started_per_cycle', | 11 'max_processes_started_per_cycle': 'max_jobs_started_per_cycle', |
12 'clean_interval': 'clean_interval_minutes', | 12 'clean_interval': 'clean_interval_minutes', |
13 'max_parse_processes': 'max_parse_processes', | 13 'max_parse_processes': 'max_parse_processes', |
14 'tick_pause_sec': 'tick_pause_sec', | 14 'tick_pause_sec': 'tick_pause_sec', |
15 'max_transfer_processes': 'max_transfer_processes', | 15 'max_transfer_processes': 'max_transfer_processes', |
16 'secs_to_wait_for_atomic_group_hosts': | 16 'secs_to_wait_for_atomic_group_hosts': |
17 'secs_to_wait_for_atomic_group_hosts', | 17 'secs_to_wait_for_atomic_group_hosts', |
18 'reverify_period_minutes': 'reverify_period_minutes', | 18 'reverify_period_minutes': 'reverify_period_minutes', |
| 19 'reverify_max_hosts_at_once': 'reverify_max_hosts_at_once', |
19 } | 20 } |
20 | 21 |
21 | 22 |
22 def __init__(self): | 23 def __init__(self): |
23 self.read_config() | 24 self.read_config() |
24 | 25 |
25 | 26 |
26 def read_config(self): | 27 def read_config(self): |
27 config = global_config.global_config | 28 config = global_config.global_config |
28 config.parse_config_file() | 29 config.parse_config_file() |
29 for field, config_option in self.FIELDS.iteritems(): | 30 for field, config_option in self.FIELDS.iteritems(): |
30 setattr(self, field, config.get_config_value(CONFIG_SECTION, | 31 setattr(self, field, config.get_config_value(CONFIG_SECTION, |
31 config_option, | 32 config_option, |
32 type=int)) | 33 type=int)) |
33 | 34 |
34 | 35 |
35 config = SchedulerConfig() | 36 config = SchedulerConfig() |
OLD | NEW |