* move some scheduler config options into a separate module, scheduler_config
* add a little embedded HTTP server to the scheduler, defined in status_server.py, running in a separate thread. this displays loaded config values and allows reloading of those config values at runtime. in the future we can extend this to do much more.
* make global_config handles empty values as nonexistent values by default. otherwise, we would have to both pass a default= and check for value == '' separately. Now, we just pass default= and it's all taken care of.
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2608 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/drone_utility.py b/scheduler/drone_utility.py
index 7e69ba0..2d305bc 100644
--- a/scheduler/drone_utility.py
+++ b/scheduler/drone_utility.py
@@ -5,7 +5,7 @@
import common
from autotest_lib.client.common_lib import utils, global_config, error
from autotest_lib.server import hosts, subcommand
-from autotest_lib.scheduler import email_manager
+from autotest_lib.scheduler import email_manager, scheduler_config
_TEMPORARY_DIRECTORY = 'drone_tmp'
_TRANSFER_FAILED_FILE = '.transfer_failed'
@@ -41,8 +41,6 @@
All paths going into and out of this class are absolute.
"""
_PS_ARGS = ['pid', 'pgid', 'ppid', 'comm', 'args']
- _MAX_TRANSFER_PROCESSES = global_config.global_config.get_config_value(
- 'SCHEDULER', 'max_transfer_processes', type=int)
_WARNING_DURATION = 60
def __init__(self):
@@ -243,7 +241,8 @@
start_time = time.time()
for method_call in calls:
results.append(method_call.execute_on(self))
- if len(self._subcommands) >= self._MAX_TRANSFER_PROCESSES:
+ max_processes = scheduler_config.config.max_transfer_processes
+ if len(self._subcommands) >= max_processes:
self.wait_for_async_commands()
self.wait_for_async_commands()