Browse code

Fix stackforge_libs installation step

When stackforge_libs is enabled, the WSME and Pecan libraries
are checked out from stackforge and installed from source instead of
pip. This change introduces a new function to perform the installation
without attempting to sync the global requirements list, since the
version of setup.py in the global requirements repository breaks the
dependencies for WSME (there is no ipaddr library in python 2, so we
need to install it, but under python 3 where it is part of the stdlib we
cannot include it in the requirements).

Fixes bug 1252488

Change-Id: I58357757ac67a919bf70178b76f65fa0a9e16242

Doug Hellmann authored on 2013/11/19 07:12:46
Showing 2 changed files
... ...
@@ -1250,7 +1250,11 @@ function safe_chmod() {
1250 1250
 
1251 1251
 # ``pip install -e`` the package, which processes the dependencies
1252 1252
 # using pip before running `setup.py develop`
1253
-# Uses globals ``STACK_USER``, ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``
1253
+#
1254
+# Updates the dependencies in project_dir from the
1255
+# openstack/requirements global list before installing anything.
1256
+#
1257
+# Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``
1254 1258
 # setup_develop directory
1255 1259
 function setup_develop() {
1256 1260
     local project_dir=$1
... ...
@@ -1266,9 +1270,7 @@ function setup_develop() {
1266 1266
             $SUDO_CMD python update.py $project_dir)
1267 1267
     fi
1268 1268
 
1269
-    pip_install -e $project_dir
1270
-    # ensure that further actions can do things like setup.py sdist
1271
-    safe_chown -R $STACK_USER $1/*.egg-info
1269
+    setup_develop_no_requirements_update $project_dir
1272 1270
 
1273 1271
     # We've just gone and possibly modified the user's source tree in an
1274 1272
     # automated way, which is considered bad form if it's a development
... ...
@@ -1285,6 +1287,18 @@ function setup_develop() {
1285 1285
     fi
1286 1286
 }
1287 1287
 
1288
+# ``pip install -e`` the package, which processes the dependencies
1289
+# using pip before running `setup.py develop`
1290
+# Uses globals ``STACK_USER``
1291
+# setup_develop_no_requirements_update directory
1292
+function setup_develop_no_requirements_update() {
1293
+    local project_dir=$1
1294
+
1295
+    pip_install -e $project_dir
1296
+    # ensure that further actions can do things like setup.py sdist
1297
+    safe_chown -R $STACK_USER $1/*.egg-info
1298
+}
1299
+
1288 1300
 
1289 1301
 # Service wrapper to start services
1290 1302
 # start_service service-name
... ...
@@ -39,10 +39,10 @@ function install_stackforge() {
39 39
     cleanup_stackforge
40 40
 
41 41
     git_clone $WSME_REPO $WSME_DIR $WSME_BRANCH
42
-    setup_develop $WSME_DIR
42
+    setup_develop_no_requirements_update $WSME_DIR
43 43
 
44 44
     git_clone $PECAN_REPO $PECAN_DIR $PECAN_BRANCH
45
-    setup_develop $PECAN_DIR
45
+    setup_develop_no_requirements_update $PECAN_DIR
46 46
 }
47 47
 
48 48
 # cleanup_stackforge() - purge possibly old versions of stackforge libraries