On 09/19/2012 03:25 PM, Lucas Meneghel Rodrigues wrote:
This is another packaging related fix, we can figure out
autotest-scheduler path with os_dep in case of system wide
install, if not there fall back to the original way of
determining both scheduler and results directory.

It needs some testing to see if it doesn't break stuff I
didn't anticipate.

Martin, by the way, I believe this supersedes one of the patches present on the Fedora rpm.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
  scheduler/monitor_db_watcher.py | 14 ++++++++++++--
  1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/scheduler/monitor_db_watcher.py b/scheduler/monitor_db_watcher.py
index f2fdb08..ac0bc3b 100644
--- a/scheduler/monitor_db_watcher.py
+++ b/scheduler/monitor_db_watcher.py
@@ -9,6 +9,7 @@ try:
  except ImportError:
      import common
  from autotest.scheduler import watcher_logging_config
+from autotest.client import os_dep
  from autotest.client.shared import error, global_config, utils
  from autotest.client.shared import logging_manager
  from autotest.scheduler import scheduler_logging_config
@@ -18,9 +19,18 @@ from autotest.scheduler import monitor_db
  PAUSE_LENGTH = 60
  STALL_TIMEOUT = 2*60*60

+output_dir = global_config.global_config.get_config_value('COMMON',
+                                                          'test_output_dir',
+                                                          default="")
+
  autodir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
-results_dir = os.path.join(autodir, 'results')
-monitor_db_path = os.path.join(autodir, 'scheduler/autotest-scheduler')
+
+try:
+    monitor_db_path = os_dep.command('autotest-scheduler')
+    results_dir = os.path.join(output_dir, 'results')
+except ValueError:
+    monitor_db_path = os.path.join(autodir, 'scheduler/autotest-scheduler')
+    results_dir = os.path.join(autodir, 'results')


  def run_banner_output(cmd):


_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to