Move monitor_db_babysitter to using utils.run to start monitor_db with environment variable for monitor_db's logs.
Add option to monitor_db.py to check if AUTOTEST_SCHEDULER_LOG_NAME is set if it is use that name for logs, otherwise use the default.
Signed-off-by: Scott Zawalski <scottz@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2959 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py
index 94f58fa..3e9e95d 100644
--- a/scheduler/monitor_db.py
+++ b/scheduler/monitor_db.py
@@ -57,8 +57,12 @@
os.environ['AUTOTEST_SCHEDULER_LOG_DIR'] = os.path.join(AUTOTEST_PATH, 'logs')
# Here we export the log name, using the same convention as autoserv's results
# directory.
-scheduler_log_name = 'scheduler.log.%s' % time.strftime('%Y-%m-%d-%H.%M.%S')
-os.environ['AUTOTEST_SCHEDULER_LOG_NAME'] = scheduler_log_name
+if os.environ.has_key('AUTOTEST_SCHEDULER_LOG_NAME'):
+ scheduler_log_name = os.environ['AUTOTEST_SCHEDULER_LOG_NAME']
+else:
+ scheduler_log_name = 'scheduler.log.%s' % time.strftime('%Y-%m-%d-%H.%M.%S')
+ os.environ['AUTOTEST_SCHEDULER_LOG_NAME'] = scheduler_log_name
+
logging.config.fileConfig(os.path.join(scheduler_dir, 'debug_scheduler.ini'))