Browse code

support installing django_openstack_auth from pypi

Part of the libs from pypi conversion, convert django_openstack_auth
to this format.

Change-Id: I97c8ea19d8aed1e0bdd62c06cfadd1d616573d76

Sean Dague authored on 2014/11/14 23:31:02
Showing 2 changed files
... ...
@@ -25,8 +25,9 @@ set +o xtrace
25 25
 # --------
26 26
 
27 27
 # Set up default directories
28
+GITDIR["django_openstack_auth"]=$DEST/django_openstack_auth
29
+
28 30
 HORIZON_DIR=$DEST/horizon
29
-HORIZONAUTH_DIR=$DEST/django_openstack_auth
30 31
 
31 32
 # local_settings.py is used to customize Dashboard settings.
32 33
 # The example file in Horizon repo is used by default.
... ...
@@ -89,9 +90,7 @@ function configure_horizon {
89 89
     # Horizon is installed as develop mode, so we can compile here.
90 90
     # Message catalog compilation is handled by Django admin script,
91 91
     # so compiling them after the installation avoids Django installation twice.
92
-    cd $HORIZON_DIR
93
-    ./run_tests.sh -N --compilemessages
94
-    cd -
92
+    (cd $HORIZON_DIR; ./run_tests.sh -N --compilemessages)
95 93
 }
96 94
 
97 95
 # init_horizon() - Initialize databases, etc.
... ...
@@ -145,15 +144,16 @@ function init_horizon {
145 145
 
146 146
 # install_django_openstack_auth() - Collect source and prepare
147 147
 function install_django_openstack_auth {
148
-    git_clone $HORIZONAUTH_REPO $HORIZONAUTH_DIR $HORIZONAUTH_BRANCH
149
-
150
-    # Compile message catalogs before installation
151
-    _prepare_message_catalog_compilation
152
-    cd $HORIZONAUTH_DIR
153
-    python setup.py compile_catalog
154
-    cd -
155
-
156
-    setup_install $HORIZONAUTH_DIR
148
+    if use_library_from_git "django_openstack_auth"; then
149
+        local dir=${GITDIR["django_openstack_auth"]}
150
+        git_clone_by_name "django_openstack_auth"
151
+        # Compile message catalogs before installation
152
+        _prepare_message_catalog_compilation
153
+        (cd $dir; python setup.py compile_catalog)
154
+        setup_dev_lib "django_openstack_auth"
155
+    fi
156
+    # if we aren't using this library from git, then we just let it
157
+    # get dragged in by the horizon setup.
157 158
 }
158 159
 
159 160
 # install_horizon() - Collect source and prepare
... ...
@@ -350,8 +350,8 @@ HEAT_TEMPLATES_REPO=${HEAT_TEMPLATES_REPO:-${GIT_BASE}/openstack/heat-templates.
350 350
 HEAT_TEMPLATES_BRANCH=${HEAT_TEMPLATES_BRANCH:-master}
351 351
 
352 352
 # django openstack_auth library
353
-HORIZONAUTH_REPO=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git}
354
-HORIZONAUTH_BRANCH=${HORIZONAUTH_BRANCH:-master}
353
+GITREPO["django_openstack_auth"]=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git}
354
+GITBRANCH["django_openstack_auth"]=${HORIZONAUTH_BRANCH:-master}
355 355
 
356 356
 # keystone middleware
357 357
 KEYSTONEMIDDLEWARE_REPO=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/keystonemiddleware.git}