diff mbox

[Branch,~linaro-validation/lava-scheduler/trunk] Rev 45: some extremely lame option parsing in lava-scheduler

Message ID 20110726053412.14571.18536.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson July 26, 2011, 5:34 a.m. UTC
------------------------------------------------------------
revno: 45
committer: Michael-Doyle Hudson <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2011-07-26 17:31:17 +1200
message:
  some extremely lame option parsing in lava-scheduler
modified:
  .bzrignore
  lava-scheduler


--
lp:lava-scheduler
https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk

You are subscribed to branch lp:lava-scheduler.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription
diff mbox

Patch

=== modified file '.bzrignore'
--- .bzrignore	2011-07-07 04:09:01 +0000
+++ .bzrignore	2011-07-26 05:31:17 +0000
@@ -2,3 +2,4 @@ 
 ./twistd.pid
 ./_trial_temp
 ./twisted/plugins/dropin.cache
+./dist

=== modified file 'lava-scheduler'
--- lava-scheduler	2011-07-25 05:41:22 +0000
+++ lava-scheduler	2011-07-26 05:31:17 +0000
@@ -11,7 +11,17 @@ 
 from lava_scheduler_daemon.dbjobsource import DatabaseJobSource
 
 source = DatabaseJobSource()
-service = BoardSet(source, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fake-dispatcher'), reactor)
+
+if sys.argv[1:] == ['--use-fake']:
+    dispatcher = os.path.join(
+        os.path.dirname(os.path.abspath(__file__)), 'fake-dispatcher')
+elif sys.argv[1:]:
+    print >>sys.stderr, "invalid options %r" % sys.argv[1:]
+    sys.exit(1)
+else:
+    dispatcher = '/usr/bin/lava-dispatcher'
+
+service = BoardSet(source, dispatcher, reactor)
 reactor.callWhenRunning(service.startService)
 
 logger = logging.getLogger('')