]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix for Bug #888820 - pip-requires file support for plugins
authorTyler Smith <tylesmit@cisco.com>
Sat, 12 Mar 2011 00:14:38 +0000 (19:14 -0500)
committerTyler Smith <tylesmit@cisco.com>
Sat, 12 Mar 2011 01:21:25 +0000 (20:21 -0500)
Change-Id: I6e0833ec0c875ec38db419a88fd6c2db02142f08

plugins/cisco-plugin/pip-requires [new file with mode: 0644]
tools/install_venv.py

diff --git a/plugins/cisco-plugin/pip-requires b/plugins/cisco-plugin/pip-requires
new file mode 100644 (file)
index 0000000..3d71059
--- /dev/null
@@ -0,0 +1 @@
+http://github.com/CiscoSystems/ncclient.git 
index f6fb708f062bf2890395b024d382ade54adcd6e1..16db235873e1ba05dfad6bb27c0a38e8f6da3bda 100644 (file)
@@ -31,7 +31,14 @@ import sys
 ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
 VENV = os.path.expanduser('~/.quantum-venv')
 VENV_EXISTS = bool(os.path.exists(VENV))
-PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires')
+
+# Find all pip-requires in the project
+PIP_REQUIRES = []
+for root, dirs, files in os.walk(os.path.join(ROOT)):
+    for f in files:
+        if f == 'pip-requires':
+            if os.path.isfile(os.path.join(root, f)):
+                PIP_REQUIRES.append(os.path.join(root, f))
 
 
 def die(message, *args):
@@ -92,8 +99,12 @@ def install_dependencies(venv=VENV):
 
     # Install greenlet by hand - just listing it in the requires file does not
     # get it in stalled in the right order
-    run_command(['tools/with_venv.sh', 'pip', 'install', '-E', venv,
-        '-r', PIP_REQUIRES], redirect_output=False)
+    # Create an install command with all found PIP_REQUIRES
+    cmd = ['tools/with_venv.sh', 'pip', 'install', '-E', venv]
+    for p in PIP_REQUIRES:
+        cmd.extend(['-r', p])
+
+    run_command(cmd, redirect_output=False)
 
     # Tell the virtual env how to "import quantum"
     pthfile = os.path.join(venv, "lib", "python2.6", "site-packages",