[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 120: Add LAVA_TEST_URL config option for specifying where to install

Message ID 20110923032913.11071.87619.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Paul Larson Sept. 23, 2011, 3:29 a.m.
Merge authors:
  Le Chi Thu le.chi.thu@linaro.org <le.chi.thu@linaro.org>
Related merge proposals:
  https://code.launchpad.net/~le-chi-thu/lava-dispatcher/lava-test-url-option/+merge/75273
  proposed by: Le Chi Thu (le-chi-thu)
------------------------------------------------------------
revno: 120 [merge]
committer: Paul Larson <paul.larson@canonical.com>
branch nick: dispatcher-release-merge
timestamp: Thu 2011-09-22 22:26:35 -0500
message:
  Add LAVA_TEST_URL config option for specifying where to install
  lava-test from
modified:
  lava_dispatcher/actions/lava-test.py
  lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf


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

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

Patch

=== modified file 'lava_dispatcher/actions/lava-test.py'
--- lava_dispatcher/actions/lava-test.py	2011-09-23 02:53:30 +0000
+++ lava_dispatcher/actions/lava-test.py	2011-09-23 03:26:35 +0000
@@ -21,11 +21,12 @@ 
 # with this program; if not, see <http://www.gnu.org/licenses>.
 
 from datetime import datetime
+import logging
 import traceback
-import logging
 
 from lava_dispatcher.actions import BaseAction
 from lava_dispatcher.client import OperationFailed, CriticalError
+from lava_dispatcher.config import get_config
 
 def _setup_testrootfs(client):
     #Make sure in master image
@@ -62,9 +63,12 @@ 
     cmd = ('chroot /mnt/root apt-get -y install bzr usbutils python-apt '
         'python-setuptools python-simplejson lsb-release')
     client.run_cmd_master(cmd, timeout=2400)
-    client.run_cmd_master('chroot /mnt/root bzr branch lp:lava-test')
-    client.run_cmd_master(
-        'chroot /mnt/root sh -c "cd lava-test && python setup.py install"')
+    client.run_cmd_master("chroot /mnt/root apt-get -y install python-pip")
+
+    dispatcher_config = get_config("lava-dispatcher")
+    lava_test_url = dispatcher_config.get("LAVA_TEST_URL")
+    logging.debug("Installing %s with pip" % lava_test_url)
+    client.run_cmd_master('chroot /mnt/root pip install -e ' + lava_test_url)
 
     #Test if lava-test installed
     try:
@@ -115,7 +119,6 @@ 
 
         if install_python:
             for module in install_python:
-                client.run_cmd_master("chroot /mnt/root apt-get -y install python-pip")
                 client.run_cmd_master("chroot /mnt/root pip install -e " + module)
 
         if register:

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf'
--- lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf	2011-09-23 02:53:30 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf	2011-09-23 03:26:35 +0000
@@ -24,3 +24,6 @@ 
 # 40 = ERROR
 # Messages with a lower number than LOGGING_LEVEL will be suppressed
 LOGGING_LEVEL = 20
+
+# The url point to the version of lava-test to be install with pip
+LAVA_TEST_URL = bzr+http://bazaar.launchpad.net/~linaro-validation/lava-test/trunk/#egg=lava-test