Browse code

fix python-* lib from git installation

We're using all the magic variables based on python-fooclient, however
all the inline code was using fooclient for variables. So we had a
mismatch, which was kindly pointed out by some of the 3rd party ci
testers.

Change-Id: I27a56222c7e8e610fba8bf97672d2a42f5cf14ca

Sean Dague authored on 2014/11/14 07:09:28
Showing 13 changed files
... ...
@@ -1615,7 +1615,6 @@ function use_library_from_git {
1615 1615
     return $enabled
1616 1616
 }
1617 1617
 
1618
-
1619 1618
 # setup a library by name. If we are trying to use the library from
1620 1619
 # git, we'll do a git based install, otherwise we'll punt and the
1621 1620
 # library should be installed by a requirements pull from another
... ...
@@ -1626,6 +1625,17 @@ function setup_lib {
1626 1626
     setup_install $dir
1627 1627
 }
1628 1628
 
1629
+# setup a library by name in editiable mode. If we are trying to use
1630
+# the library from git, we'll do a git based install, otherwise we'll
1631
+# punt and the library should be installed by a requirements pull from
1632
+# another project.
1633
+#
1634
+# use this for non namespaced libraries
1635
+function setup_dev_lib {
1636
+    local name=$1
1637
+    local dir=${GITDIR[$name]}
1638
+    setup_develop $dir
1639
+}
1629 1640
 
1630 1641
 # this should be used if you want to install globally, all libraries should
1631 1642
 # use this, especially *oslo* ones
... ...
@@ -35,7 +35,7 @@ set +o xtrace
35 35
 # --------
36 36
 
37 37
 # Set up default directories
38
-GITDIR["ceilometerclient"]=$DEST/python-ceilometerclient
38
+GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient
39 39
 
40 40
 CEILOMETER_DIR=$DEST/ceilometer
41 41
 CEILOMETER_CONF_DIR=/etc/ceilometer
... ...
@@ -269,10 +269,10 @@ function install_ceilometer {
269 269
 
270 270
 # install_ceilometerclient() - Collect source and prepare
271 271
 function install_ceilometerclient {
272
-    if use_library_from_git "ceilometerclient"; then
273
-        git_clone_by_name "ceilometerclient"
274
-        setup_develop "ceilometerclient"
275
-        sudo install -D -m 0644 -o $STACK_USER {$CEILOMETERCLIENT_DIR/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
272
+    if use_library_from_git "python-ceilometerclient"; then
273
+        git_clone_by_name "python-ceilometerclient"
274
+        setup_dev_lib "python-ceilometerclient"
275
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ceilometerclient"]}/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
276 276
     fi
277 277
 }
278 278
 
... ...
@@ -36,7 +36,7 @@ if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then
36 36
 fi
37 37
 
38 38
 # set up default directories
39
-GITDIR["cinderclient"]=$DEST/python-cinderclient
39
+GITDIR["python-cinderclient"]=$DEST/python-cinderclient
40 40
 
41 41
 CINDER_DIR=$DEST/cinder
42 42
 CINDER_STATE_PATH=${CINDER_STATE_PATH:=$DATA_DIR/cinder}
... ...
@@ -403,10 +403,10 @@ function install_cinder {
403 403
 
404 404
 # install_cinderclient() - Collect source and prepare
405 405
 function install_cinderclient {
406
-    if use_library_from_git "cinderclient"; then
407
-        git_clone_by_name "cinderclient"
408
-        setup_develop "cinderclient"
409
-        sudo install -D -m 0644 -o $STACK_USER {$CINDERCLIENT_DIR/tools/,/etc/bash_completion.d/}cinder.bash_completion
406
+    if use_library_from_git "python-cinderclient"; then
407
+        git_clone_by_name "python-cinderclient"
408
+        setup_dev_lib "python-cinderclient"
409
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-cinderclient"]}/tools/,/etc/bash_completion.d/}cinder.bash_completion
410 410
     fi
411 411
 }
412 412
 
... ...
@@ -27,7 +27,7 @@ set +o xtrace
27 27
 # --------
28 28
 
29 29
 # Set up default directories
30
-GITDIR["glanceclient"]=$DEST/python-glanceclient
30
+GITDIR["python-glanceclient"]=$DEST/python-glanceclient
31 31
 
32 32
 GLANCE_DIR=$DEST/glance
33 33
 GLANCE_STORE_DIR=$DEST/glance_store
... ...
@@ -287,9 +287,9 @@ function init_glance {
287 287
 
288 288
 # install_glanceclient() - Collect source and prepare
289 289
 function install_glanceclient {
290
-    if use_library_from_git "glanceclient"; then
291
-        git_clone_by_name "glanceclient"
292
-        setup_develop "glanceclient"
290
+    if use_library_from_git "python-glanceclient"; then
291
+        git_clone_by_name "python-glanceclient"
292
+        setup_dev_lib "python-glanceclient"
293 293
     fi
294 294
 }
295 295
 
... ...
@@ -29,7 +29,7 @@ set +o xtrace
29 29
 # --------
30 30
 
31 31
 # set up default directories
32
-GITDIR["heatclient"]=$DEST/python-heatclient
32
+GITDIR["python-heatclient"]=$DEST/python-heatclient
33 33
 
34 34
 HEAT_DIR=$DEST/heat
35 35
 HEAT_CFNTOOLS_DIR=$DEST/heat-cfntools
... ...
@@ -184,10 +184,10 @@ function create_heat_cache_dir {
184 184
 
185 185
 # install_heatclient() - Collect source and prepare
186 186
 function install_heatclient {
187
-    if use_library_from_git "heatclient"; then
188
-        git_clone_by_name "heatclient"
189
-        setup_develop "heatclient"
190
-        sudo install -D -m 0644 -o $STACK_USER {$HEATCLIENT_DIR/tools/,/etc/bash_completion.d/}heat.bash_completion
187
+    if use_library_from_git "python-heatclient"; then
188
+        git_clone_by_name "python-heatclient"
189
+        setup_dev_lib "python-heatclient"
190
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-heatclient"]}/tools/,/etc/bash_completion.d/}heat.bash_completion
191 191
     fi
192 192
 }
193 193
 
... ...
@@ -28,7 +28,7 @@ set +o pipefail
28 28
 # --------
29 29
 
30 30
 # Set up default directories
31
-GITDIR["ironicclient"]=$DEST/python-ironicclient
31
+GITDIR["python-ironicclient"]=$DEST/python-ironicclient
32 32
 
33 33
 IRONIC_DIR=$DEST/ironic
34 34
 IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent
... ...
@@ -151,10 +151,10 @@ function install_ironic {
151 151
 
152 152
 # install_ironicclient() - Collect sources and prepare
153 153
 function install_ironicclient {
154
-    if use_library_from_git "ironicclient"; then
155
-        git_clone_by_name "ironicclient"
156
-        setup_develop "ironicclient"
157
-        sudo install -D -m 0644 -o $STACK_USER {$IRONICCLIENT_DIR/tools/,/etc/bash_completion.d/}ironic.bash_completion
154
+    if use_library_from_git "python-ironicclient"; then
155
+        git_clone_by_name "python-ironicclient"
156
+        setup_dev_lib "python-ironicclient"
157
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ironicclient"]}/tools/,/etc/bash_completion.d/}ironic.bash_completion
158 158
     else
159 159
         # nothing actually "requires" ironicclient, so force instally from pypi
160 160
         pip_install python-ironicclient
... ...
@@ -33,7 +33,7 @@ set +o xtrace
33 33
 # --------
34 34
 
35 35
 # Set up default directories
36
-GITDIR["keystoneclient"]=$DEST/python-keystoneclient
36
+GITDIR["python-keystoneclient"]=$DEST/python-keystoneclient
37 37
 
38 38
 KEYSTONE_DIR=$DEST/keystone
39 39
 KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone}
... ...
@@ -480,10 +480,10 @@ function init_keystone {
480 480
 
481 481
 # install_keystoneclient() - Collect source and prepare
482 482
 function install_keystoneclient {
483
-    if use_library_from_git "keystoneclient"; then
484
-        git_clone_by_name "keystoneclient"
485
-        setup_develop "keystoneclient"
486
-        sudo install -D -m 0644 -o $STACK_USER {$KEYSTONECLIENT_DIR/tools/,/etc/bash_completion.d/}keystone.bash_completion
483
+    if use_library_from_git "python-keystoneclient"; then
484
+        git_clone_by_name "python-keystoneclient"
485
+        setup_dev_lib "python-keystoneclient"
486
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-keystoneclient"]}/tools/,/etc/bash_completion.d/}keystone.bash_completion
487 487
     fi
488 488
 }
489 489
 
... ...
@@ -67,7 +67,7 @@ fi
67 67
 
68 68
 
69 69
 # Set up default directories
70
-GITDIR["neutronclient"]=$DEST/python-neutronclient
70
+GITDIR["python-neutronclient"]=$DEST/python-neutronclient
71 71
 
72 72
 
73 73
 NEUTRON_DIR=$DEST/neutron
... ...
@@ -620,10 +620,10 @@ function install_neutron {
620 620
 
621 621
 # install_neutronclient() - Collect source and prepare
622 622
 function install_neutronclient {
623
-    if use_library_from_git "neutronclient"; then
624
-        git_clone_by_name "neutronclient"
625
-        setup_develop "neutronclient"
626
-        sudo install -D -m 0644 -o $STACK_USER {$NEUTRONCLIENT_DIR/tools/,/etc/bash_completion.d/}neutron.bash_completion
623
+    if use_library_from_git "python-neutronclient"; then
624
+        git_clone_by_name "python-neutronclient"
625
+        setup_dev_lib "python-neutronclient"
626
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-neutronclient"]}/tools/,/etc/bash_completion.d/}neutron.bash_completion
627 627
     fi
628 628
 }
629 629
 
... ...
@@ -29,7 +29,7 @@ set +o xtrace
29 29
 # --------
30 30
 
31 31
 # Set up default directories
32
-GITDIR["novaclient"]=$DEST/python-novaclient
32
+GITDIR["python-novaclient"]=$DEST/python-novaclient
33 33
 
34 34
 
35 35
 NOVA_DIR=$DEST/nova
... ...
@@ -639,10 +639,10 @@ function init_nova {
639 639
 
640 640
 # install_novaclient() - Collect source and prepare
641 641
 function install_novaclient {
642
-    if use_library_from_git "novaclient"; then
643
-        git_clone_by_name "novaclient"
644
-        setup_develop "novaclient"
645
-        sudo install -D -m 0644 -o $STACK_USER {$NOVACLIENT_DIR/tools/,/etc/bash_completion.d/}nova.bash_completion
642
+    if use_library_from_git "python-novaclient"; then
643
+        git_clone_by_name "python-novaclient"
644
+        setup_dev_lib "python-novaclient"
645
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-novaclient"]}/tools/,/etc/bash_completion.d/}nova.bash_completion
646 646
     fi
647 647
 }
648 648
 
... ...
@@ -34,7 +34,7 @@ if is_ssl_enabled_service "s-proxy" || is_service_enabled tls-proxy; then
34 34
 fi
35 35
 
36 36
 # Set up default directories
37
-GITDIR["swiftclient"]=$DEST/python-swiftclient
37
+GITDIR["python-swiftclient"]=$DEST/python-swiftclient
38 38
 
39 39
 
40 40
 SWIFT_DIR=$DEST/swift
... ...
@@ -677,9 +677,9 @@ function install_swift {
677 677
 }
678 678
 
679 679
 function install_swiftclient {
680
-    if use_library_from_git "swiftclient"; then
681
-        git_clone_by_name "swiftclient"
682
-        setup_develop "swiftclient"
680
+    if use_library_from_git "python-swiftclient"; then
681
+        git_clone_by_name "python-swiftclient"
682
+        setup_dev_lib "python-swiftclient"
683 683
     fi
684 684
 }
685 685
 
... ...
@@ -28,7 +28,7 @@ else
28 28
 fi
29 29
 
30 30
 # Set up default configuration
31
-GITDIR["troveclient"]=$DEST/python-troveclient
31
+GITDIR["python-troveclient"]=$DEST/python-troveclient
32 32
 
33 33
 TROVE_DIR=$DEST/trove
34 34
 TROVE_CONF_DIR=/etc/trove
... ...
@@ -181,9 +181,9 @@ function configure_trove {
181 181
 
182 182
 # install_troveclient() - Collect source and prepare
183 183
 function install_troveclient {
184
-    if use_library_from_git "troveclient"; then
185
-        git_clone_by_name "troveclient"
186
-        setup_develop "troveclient"
184
+    if use_library_from_git "python-troveclient"; then
185
+        git_clone_by_name "python-troveclient"
186
+        setup_dev_lib "python-troveclient"
187 187
     fi
188 188
 }
189 189
 
... ...
@@ -584,7 +584,7 @@ if [[ -d $TOP_DIR/extras.d ]]; then
584 584
 fi
585 585
 
586 586
 # Set the destination directories for other OpenStack projects
587
-GITDIR["openstackclient"]=$DEST/python-openstackclient
587
+GITDIR["python-openstackclient"]=$DEST/python-openstackclient
588 588
 
589 589
 # Interactive Configuration
590 590
 # -------------------------
... ...
@@ -788,9 +788,9 @@ fi
788 788
 install_keystonemiddleware
789 789
 
790 790
 # install the OpenStack client, needed for most setup commands
791
-if use_library_from_git "openstackclient"; then
792
-    git_clone_by_name "openstackclient"
793
-    setup_develop "openstackclient"
791
+if use_library_from_git "python-openstackclient"; then
792
+    git_clone_by_name "python-openstackclient"
793
+    setup_dev_lib "python-openstackclient"
794 794
 else
795 795
     pip_install python-openstackclient
796 796
 fi
... ...
@@ -210,48 +210,48 @@ GITBRANCH["tempest_lib"]=${TEMPEST_LIB_BRANCH:-master}
210 210
 ##############
211 211
 
212 212
 # ceilometer client library
213
-GITREPO["ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git}
214
-GITBRANCH["ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master}
213
+GITREPO["python-ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git}
214
+GITBRANCH["python-ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master}
215 215
 
216 216
 # volume client
217
-GITREPO["cinderclient"]=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
218
-GITBRACH["cinderclient"]=${CINDERCLIENT_BRANCH:-master}
217
+GITREPO["python-cinderclient"]=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
218
+GITBRACH["python-cinderclient"]=${CINDERCLIENT_BRANCH:-master}
219 219
 
220 220
 # python glance client library
221
-GITREPO["glanceclient"]=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git}
222
-GITBRANCH["glanceclient"]=${GLANCECLIENT_BRANCH:-master}
221
+GITREPO["python-glanceclient"]=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git}
222
+GITBRANCH["python-glanceclient"]=${GLANCECLIENT_BRANCH:-master}
223 223
 
224 224
 # python heat client library
225
-GITREPO["heatclient"]=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git}
226
-GITBRANCH["heatclient"]=${HEATCLIENT_BRANCH:-master}
225
+GITREPO["python-heatclient"]=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git}
226
+GITBRANCH["python-heatclient"]=${HEATCLIENT_BRANCH:-master}
227 227
 
228 228
 # ironic client
229
-GITREPO["ironicclient"]=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git}
230
-GITBRANCH["ironicclient"]=${IRONICCLIENT_BRANCH:-master}
229
+GITREPO["python-ironicclient"]=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git}
230
+GITBRANCH["python-ironicclient"]=${IRONICCLIENT_BRANCH:-master}
231 231
 
232 232
 # python keystone client library to nova that horizon uses
233
-GITREPO["keystoneclient"]=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git}
234
-GITBRANCH["keystoneclient"]=${KEYSTONECLIENT_BRANCH:-master}
233
+GITREPO["python-keystoneclient"]=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git}
234
+GITBRANCH["python-keystoneclient"]=${KEYSTONECLIENT_BRANCH:-master}
235 235
 
236 236
 # neutron client
237
-GITREPO["neutronclient"]=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
238
-GITBRANCH["neutronclient"]=${NEUTRONCLIENT_BRANCH:-master}
237
+GITREPO["python-neutronclient"]=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
238
+GITBRANCH["python-neutronclient"]=${NEUTRONCLIENT_BRANCH:-master}
239 239
 
240 240
 # python client library to nova that horizon (and others) use
241
-GITREPO["novaclient"]=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
242
-GITBRANCH["novaclient"]=${NOVACLIENT_BRANCH:-master}
241
+GITREPO["python-novaclient"]=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
242
+GITBRANCH["python-novaclient"]=${NOVACLIENT_BRANCH:-master}
243 243
 
244 244
 # python swift client library
245
-GITREPO["swiftclient"]=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git}
246
-GITBRANCH["swiftclient"]=${SWIFTCLIENT_BRANCH:-master}
245
+GITREPO["python-swiftclient"]=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git}
246
+GITBRANCH["python-swiftclient"]=${SWIFTCLIENT_BRANCH:-master}
247 247
 
248 248
 # trove client library test
249
-GITREPO["troveclient"]=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
250
-GITBRANCH["troveclient"]=${TROVECLIENT_BRANCH:-master}
249
+GITREPO["python-troveclient"]=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
250
+GITBRANCH["python-troveclient"]=${TROVECLIENT_BRANCH:-master}
251 251
 
252 252
 # consolidated openstack python client
253
-GITREPO["openstackclient"]=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
254
-GITBRANCH["openstackclient"]=${OPENSTACKCLIENT_BRANCH:-master}
253
+GITREPO["python-openstackclient"]=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
254
+GITBRANCH["python-openstackclient"]=${OPENSTACKCLIENT_BRANCH:-master}
255 255
 
256 256
 ###################
257 257
 #