Browse code

support installing clients and supporting libraries at released versions

expand the devstack support for libraries from released versions to
support python-* clients and supporting libraries. This is a collapse
of the master patch series that took a while to get correct.

add unit tests for GIT* definitions

This adds unit tests for all the GIT* definitions, ensuring that for
libraries we think should be defined, they are. It exposed a bug in
glance_store definitions in the process.

The GITDIR definition for python-openstackclient is moved to stackrc
for testability.

Change-Id: I26fac0ccf8fd4818e24618d56bf04b32306f88f6

Sean Dague authored on 2014/11/01 09:37:45
Showing 18 changed files
... ...
@@ -11,7 +11,6 @@ if is_service_enabled trove; then
11 11
         cleanup_trove
12 12
     elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
13 13
         echo_summary "Configuring Trove"
14
-        configure_troveclient
15 14
         configure_trove
16 15
 
17 16
         if is_service_enabled key; then
... ...
@@ -1594,6 +1594,17 @@ function setup_lib {
1594 1594
     setup_install $dir
1595 1595
 }
1596 1596
 
1597
+# setup a library by name in editiable mode. If we are trying to use
1598
+# the library from git, we'll do a git based install, otherwise we'll
1599
+# punt and the library should be installed by a requirements pull from
1600
+# another project.
1601
+#
1602
+# use this for non namespaced libraries
1603
+function setup_dev_lib {
1604
+    local name=$1
1605
+    local dir=${GITDIR[$name]}
1606
+    setup_develop $dir
1607
+}
1597 1608
 
1598 1609
 # this should be used if you want to install globally, all libraries should
1599 1610
 # use this, especially *oslo* ones
... ...
@@ -35,8 +35,9 @@ set +o xtrace
35 35
 # --------
36 36
 
37 37
 # Set up default directories
38
+GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient
39
+
38 40
 CEILOMETER_DIR=$DEST/ceilometer
39
-CEILOMETERCLIENT_DIR=$DEST/python-ceilometerclient
40 41
 CEILOMETER_CONF_DIR=/etc/ceilometer
41 42
 CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
42 43
 CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
... ...
@@ -246,9 +247,11 @@ function install_ceilometer {
246 246
 
247 247
 # install_ceilometerclient() - Collect source and prepare
248 248
 function install_ceilometerclient {
249
-    git_clone $CEILOMETERCLIENT_REPO $CEILOMETERCLIENT_DIR $CEILOMETERCLIENT_BRANCH
250
-    setup_develop $CEILOMETERCLIENT_DIR
251
-    sudo install -D -m 0644 -o $STACK_USER {$CEILOMETERCLIENT_DIR/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
249
+    if use_library_from_git "python-ceilometerclient"; then
250
+        git_clone_by_name "python-ceilometerclient"
251
+        setup_dev_lib "python-ceilometerclient"
252
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ceilometerclient"]}/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
253
+    fi
252 254
 }
253 255
 
254 256
 # start_ceilometer() - Start running processes, including screen
... ...
@@ -36,8 +36,9 @@ if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then
36 36
 fi
37 37
 
38 38
 # set up default directories
39
+GITDIR["python-cinderclient"]=$DEST/python-cinderclient
40
+
39 41
 CINDER_DIR=$DEST/cinder
40
-CINDERCLIENT_DIR=$DEST/python-cinderclient
41 42
 CINDER_STATE_PATH=${CINDER_STATE_PATH:=$DATA_DIR/cinder}
42 43
 CINDER_AUTH_CACHE_DIR=${CINDER_AUTH_CACHE_DIR:-/var/cache/cinder}
43 44
 
... ...
@@ -401,9 +402,11 @@ function install_cinder {
401 401
 
402 402
 # install_cinderclient() - Collect source and prepare
403 403
 function install_cinderclient {
404
-    git_clone $CINDERCLIENT_REPO $CINDERCLIENT_DIR $CINDERCLIENT_BRANCH
405
-    setup_develop $CINDERCLIENT_DIR
406
-    sudo install -D -m 0644 -o $STACK_USER {$CINDERCLIENT_DIR/tools/,/etc/bash_completion.d/}cinder.bash_completion
404
+    if use_library_from_git "python-cinderclient"; then
405
+        git_clone_by_name "python-cinderclient"
406
+        setup_dev_lib "python-cinderclient"
407
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-cinderclient"]}/tools/,/etc/bash_completion.d/}cinder.bash_completion
408
+    fi
407 409
 }
408 410
 
409 411
 # apply config.d approach for cinder volumes directory
... ...
@@ -27,9 +27,10 @@ set +o xtrace
27 27
 # --------
28 28
 
29 29
 # Set up default directories
30
+GITDIR["python-glanceclient"]=$DEST/python-glanceclient
31
+GITDIR["glance_store"]=$DEST/glance_store
32
+
30 33
 GLANCE_DIR=$DEST/glance
31
-GLANCE_STORE_DIR=$DEST/glance_store
32
-GLANCECLIENT_DIR=$DEST/python-glanceclient
33 34
 GLANCE_CACHE_DIR=${GLANCE_CACHE_DIR:=$DATA_DIR/glance/cache}
34 35
 GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
35 36
 GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance}
... ...
@@ -286,16 +287,20 @@ function init_glance {
286 286
 
287 287
 # install_glanceclient() - Collect source and prepare
288 288
 function install_glanceclient {
289
-    git_clone $GLANCECLIENT_REPO $GLANCECLIENT_DIR $GLANCECLIENT_BRANCH
290
-    setup_develop $GLANCECLIENT_DIR
289
+    if use_library_from_git "python-glanceclient"; then
290
+        git_clone_by_name "python-glanceclient"
291
+        setup_dev_lib "python-glanceclient"
292
+    fi
291 293
 }
292 294
 
293 295
 # install_glance() - Collect source and prepare
294 296
 function install_glance {
295 297
     # Install glance_store from git so we make sure we're testing
296 298
     # the latest code.
297
-    git_clone $GLANCE_STORE_REPO $GLANCE_STORE_DIR $GLANCE_STORE_BRANCH
298
-    setup_develop $GLANCE_STORE_DIR
299
+    if use_library_from_git "glance_store"; then
300
+        git_clone_by_name "glance_store"
301
+        setup_dev_lib "glance_store"
302
+    fi
299 303
 
300 304
     git_clone $GLANCE_REPO $GLANCE_DIR $GLANCE_BRANCH
301 305
     setup_develop $GLANCE_DIR
... ...
@@ -29,8 +29,9 @@ set +o xtrace
29 29
 # --------
30 30
 
31 31
 # set up default directories
32
+GITDIR["python-heatclient"]=$DEST/python-heatclient
33
+
32 34
 HEAT_DIR=$DEST/heat
33
-HEATCLIENT_DIR=$DEST/python-heatclient
34 35
 HEAT_CFNTOOLS_DIR=$DEST/heat-cfntools
35 36
 HEAT_TEMPLATES_REPO_DIR=$DEST/heat-templates
36 37
 HEAT_AUTH_CACHE_DIR=${HEAT_AUTH_CACHE_DIR:-/var/cache/heat}
... ...
@@ -183,9 +184,11 @@ function create_heat_cache_dir {
183 183
 
184 184
 # install_heatclient() - Collect source and prepare
185 185
 function install_heatclient {
186
-    git_clone $HEATCLIENT_REPO $HEATCLIENT_DIR $HEATCLIENT_BRANCH
187
-    setup_develop $HEATCLIENT_DIR
188
-    sudo install -D -m 0644 -o $STACK_USER {$HEATCLIENT_DIR/tools/,/etc/bash_completion.d/}heat.bash_completion
186
+    if use_library_from_git "python-heatclient"; then
187
+        git_clone_by_name "python-heatclient"
188
+        setup_dev_lib "python-heatclient"
189
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-heatclient"]}/tools/,/etc/bash_completion.d/}heat.bash_completion
190
+    fi
189 191
 }
190 192
 
191 193
 # install_heat() - Collect source and prepare
... ...
@@ -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.
... ...
@@ -84,6 +85,12 @@ function cleanup_horizon {
84 84
 # configure_horizon() - Set config files, create data dirs, etc
85 85
 function configure_horizon {
86 86
     setup_develop $HORIZON_DIR
87
+
88
+    # Compile message catalogs.
89
+    # Horizon is installed as develop mode, so we can compile here.
90
+    # Message catalog compilation is handled by Django admin script,
91
+    # so compiling them after the installation avoids Django installation twice.
92
+    (cd $HORIZON_DIR; ./run_tests.sh -N --compilemessages)
87 93
 }
88 94
 
89 95
 # init_horizon() - Initialize databases, etc.
... ...
@@ -137,8 +144,16 @@ function init_horizon {
137 137
 
138 138
 # install_django_openstack_auth() - Collect source and prepare
139 139
 function install_django_openstack_auth {
140
-    git_clone $HORIZONAUTH_REPO $HORIZONAUTH_DIR $HORIZONAUTH_BRANCH
141
-    setup_install $HORIZONAUTH_DIR
140
+    if use_library_from_git "django_openstack_auth"; then
141
+        local dir=${GITDIR["django_openstack_auth"]}
142
+        git_clone_by_name "django_openstack_auth"
143
+        # Compile message catalogs before installation
144
+        _prepare_message_catalog_compilation
145
+        (cd $dir; python setup.py compile_catalog)
146
+        setup_dev_lib "django_openstack_auth"
147
+    fi
148
+    # if we aren't using this library from git, then we just let it
149
+    # get dragged in by the horizon setup.
142 150
 }
143 151
 
144 152
 # install_horizon() - Collect source and prepare
... ...
@@ -28,11 +28,12 @@ set +o pipefail
28 28
 # --------
29 29
 
30 30
 # Set up default directories
31
+GITDIR["python-ironicclient"]=$DEST/python-ironicclient
32
+
31 33
 IRONIC_DIR=$DEST/ironic
32 34
 IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent
33 35
 IRONIC_DATA_DIR=$DATA_DIR/ironic
34 36
 IRONIC_STATE_PATH=/var/lib/ironic
35
-IRONICCLIENT_DIR=$DEST/python-ironicclient
36 37
 IRONIC_AUTH_CACHE_DIR=${IRONIC_AUTH_CACHE_DIR:-/var/cache/ironic}
37 38
 IRONIC_CONF_DIR=${IRONIC_CONF_DIR:-/etc/ironic}
38 39
 IRONIC_CONF_FILE=$IRONIC_CONF_DIR/ironic.conf
... ...
@@ -150,9 +151,14 @@ function install_ironic {
150 150
 
151 151
 # install_ironicclient() - Collect sources and prepare
152 152
 function install_ironicclient {
153
-    git_clone $IRONICCLIENT_REPO $IRONICCLIENT_DIR $IRONICCLIENT_BRANCH
154
-    setup_develop $IRONICCLIENT_DIR
155
-    sudo install -D -m 0644 -o $STACK_USER {$IRONICCLIENT_DIR/tools/,/etc/bash_completion.d/}ironic.bash_completion
153
+    if use_library_from_git "python-ironicclient"; then
154
+        git_clone_by_name "python-ironicclient"
155
+        setup_dev_lib "python-ironicclient"
156
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ironicclient"]}/tools/,/etc/bash_completion.d/}ironic.bash_completion
157
+    else
158
+        # nothing actually "requires" ironicclient, so force instally from pypi
159
+        pip_install python-ironicclient
160
+    fi
156 161
 }
157 162
 
158 163
 # _cleanup_ironic_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
... ...
@@ -33,6 +33,9 @@ set +o xtrace
33 33
 # --------
34 34
 
35 35
 # Set up default directories
36
+GITDIR["python-keystoneclient"]=$DEST/python-keystoneclient
37
+GITDIR["keystonemiddleware"]=$DEST/keystonemiddleware
38
+
36 39
 KEYSTONE_DIR=$DEST/keystone
37 40
 KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone}
38 41
 KEYSTONE_CONF=$KEYSTONE_CONF_DIR/keystone.conf
... ...
@@ -44,9 +47,6 @@ else
44 44
     KEYSTONE_WSGI_DIR=${KEYSTONE_WSGI_DIR:-/var/www/keystone}
45 45
 fi
46 46
 
47
-KEYSTONEMIDDLEWARE_DIR=$DEST/keystonemiddleware
48
-KEYSTONECLIENT_DIR=$DEST/python-keystoneclient
49
-
50 47
 # Set up additional extensions, such as oauth1, federation
51 48
 # Example of KEYSTONE_EXTENSIONS=oauth1,federation
52 49
 KEYSTONE_EXTENSIONS=${KEYSTONE_EXTENSIONS:-}
... ...
@@ -479,15 +479,19 @@ function init_keystone {
479 479
 
480 480
 # install_keystoneclient() - Collect source and prepare
481 481
 function install_keystoneclient {
482
-    git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH
483
-    setup_develop $KEYSTONECLIENT_DIR
484
-    sudo install -D -m 0644 -o $STACK_USER {$KEYSTONECLIENT_DIR/tools/,/etc/bash_completion.d/}keystone.bash_completion
482
+    if use_library_from_git "python-keystoneclient"; then
483
+        git_clone_by_name "python-keystoneclient"
484
+        setup_dev_lib "python-keystoneclient"
485
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-keystoneclient"]}/tools/,/etc/bash_completion.d/}keystone.bash_completion
486
+    fi
485 487
 }
486 488
 
487 489
 # install_keystonemiddleware() - Collect source and prepare
488 490
 function install_keystonemiddleware {
489
-    git_clone $KEYSTONEMIDDLEWARE_REPO $KEYSTONEMIDDLEWARE_DIR $KEYSTONEMIDDLEWARE_BRANCH
490
-    setup_install $KEYSTONEMIDDLEWARE_DIR
491
+    if use_library_from_git "keystonemiddleware"; then
492
+        git_clone_by_name "keystonemiddleware"
493
+        setup_dev_lib "keystonemiddleware"
494
+    fi
491 495
 }
492 496
 
493 497
 # install_keystone() - Collect source and prepare
... ...
@@ -75,8 +75,10 @@ fi
75 75
 
76 76
 
77 77
 # Set up default directories
78
+GITDIR["python-neutronclient"]=$DEST/python-neutronclient
79
+
80
+
78 81
 NEUTRON_DIR=$DEST/neutron
79
-NEUTRONCLIENT_DIR=$DEST/python-neutronclient
80 82
 NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
81 83
 
82 84
 # Support entry points installation of console scripts
... ...
@@ -599,9 +601,11 @@ function install_neutron {
599 599
 
600 600
 # install_neutronclient() - Collect source and prepare
601 601
 function install_neutronclient {
602
-    git_clone $NEUTRONCLIENT_REPO $NEUTRONCLIENT_DIR $NEUTRONCLIENT_BRANCH
603
-    setup_develop $NEUTRONCLIENT_DIR
604
-    sudo install -D -m 0644 -o $STACK_USER {$NEUTRONCLIENT_DIR/tools/,/etc/bash_completion.d/}neutron.bash_completion
602
+    if use_library_from_git "python-neutronclient"; then
603
+        git_clone_by_name "python-neutronclient"
604
+        setup_dev_lib "python-neutronclient"
605
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-neutronclient"]}/tools/,/etc/bash_completion.d/}neutron.bash_completion
606
+    fi
605 607
 }
606 608
 
607 609
 # install_neutron_agent_packages() - Collect source and prepare
... ...
@@ -29,8 +29,10 @@ set +o xtrace
29 29
 # --------
30 30
 
31 31
 # Set up default directories
32
+GITDIR["python-novaclient"]=$DEST/python-novaclient
33
+
34
+
32 35
 NOVA_DIR=$DEST/nova
33
-NOVACLIENT_DIR=$DEST/python-novaclient
34 36
 NOVA_STATE_PATH=${NOVA_STATE_PATH:=$DATA_DIR/nova}
35 37
 # INSTANCES_PATH is the previous name for this
36 38
 NOVA_INSTANCES_PATH=${NOVA_INSTANCES_PATH:=${INSTANCES_PATH:=$NOVA_STATE_PATH/instances}}
... ...
@@ -631,9 +633,11 @@ function init_nova {
631 631
 
632 632
 # install_novaclient() - Collect source and prepare
633 633
 function install_novaclient {
634
-    git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
635
-    setup_develop $NOVACLIENT_DIR
636
-    sudo install -D -m 0644 -o $STACK_USER {$NOVACLIENT_DIR/tools/,/etc/bash_completion.d/}nova.bash_completion
634
+    if use_library_from_git "python-novaclient"; then
635
+        git_clone_by_name "python-novaclient"
636
+        setup_dev_lib "python-novaclient"
637
+        sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-novaclient"]}/tools/,/etc/bash_completion.d/}nova.bash_completion
638
+    fi
637 639
 }
638 640
 
639 641
 # install_nova() - Collect source and prepare
... ...
@@ -21,16 +21,9 @@ set +o xtrace
21 21
 # Defaults
22 22
 # --------
23 23
 
24
-# Set up default repos
25
-SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git}
26
-SAHARA_BRANCH=${SAHARA_BRANCH:-stable/juno}
27
-
28
-SAHARA_PYTHONCLIENT_REPO=${SAHARA_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git}
29
-SAHARA_PYTHONCLIENT_BRANCH=${SAHARA_PYTHONCLIENT_BRANCH:-master}
30
-
31 24
 # Set up default directories
25
+GITDIR["python-saharaclient"]=$DEST/python-saharaclient
32 26
 SAHARA_DIR=$DEST/sahara
33
-SAHARA_PYTHONCLIENT_DIR=$DEST/python-saharaclient
34 27
 
35 28
 SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara}
36 29
 SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf
... ...
@@ -153,8 +146,10 @@ function install_sahara {
153 153
 
154 154
 # install_python_saharaclient() - Collect source and prepare
155 155
 function install_python_saharaclient {
156
-    git_clone $SAHARA_PYTHONCLIENT_REPO $SAHARA_PYTHONCLIENT_DIR $SAHARA_PYTHONCLIENT_BRANCH
157
-    setup_develop $SAHARA_PYTHONCLIENT_DIR
156
+    if use_library_from_git "python-saharaclient"; then
157
+        git_clone_by_name "python-saharaclient"
158
+        setup_dev_lib "python-saharaclient"
159
+    fi
158 160
 }
159 161
 
160 162
 # start_sahara() - Start running processes, including screen
... ...
@@ -34,8 +34,10 @@ 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["python-swiftclient"]=$DEST/python-swiftclient
38
+
39
+
37 40
 SWIFT_DIR=$DEST/swift
38
-SWIFTCLIENT_DIR=$DEST/python-swiftclient
39 41
 SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift}
40 42
 SWIFT_APACHE_WSGI_DIR=${SWIFT_APACHE_WSGI_DIR:-/var/www/swift}
41 43
 SWIFT3_DIR=$DEST/swift3
... ...
@@ -654,8 +656,10 @@ function install_swift {
654 654
 }
655 655
 
656 656
 function install_swiftclient {
657
-    git_clone $SWIFTCLIENT_REPO $SWIFTCLIENT_DIR $SWIFTCLIENT_BRANCH
658
-    setup_develop $SWIFTCLIENT_DIR
657
+    if use_library_from_git "python-swiftclient"; then
658
+        git_clone_by_name "python-swiftclient"
659
+        setup_dev_lib "python-swiftclient"
660
+    fi
659 661
 }
660 662
 
661 663
 # start_swift() - Start running processes, including screen
... ...
@@ -44,11 +44,12 @@ set +o xtrace
44 44
 # --------
45 45
 
46 46
 # Set up default directories
47
+GITDIR["tempest-lib"]=$DEST/tempest-lib
48
+
47 49
 TEMPEST_DIR=$DEST/tempest
48 50
 TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
49 51
 TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
50 52
 TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
51
-TEMPEST_LIB_DIR=$DEST/tempest-lib
52 53
 
53 54
 NOVA_SOURCE_DIR=$DEST/nova
54 55
 
... ...
@@ -433,8 +434,10 @@ function create_tempest_accounts {
433 433
 
434 434
 # install_tempest_lib() - Collect source, prepare, and install tempest-lib
435 435
 function install_tempest_lib {
436
-    git_clone $TEMPEST_LIB_REPO $TEMPEST_LIB_DIR $TEMPEST_LIB_BRANCH
437
-    setup_develop $TEMPEST_LIB_DIR
436
+    if use_library_from_git "tempest-lib"; then
437
+        git_clone_by_name "tempest-lib"
438
+        setup_dev_lib "tempest-lib"
439
+    fi
438 440
 }
439 441
 
440 442
 # install_tempest() - Collect source and prepare
... ...
@@ -28,8 +28,9 @@ else
28 28
 fi
29 29
 
30 30
 # Set up default configuration
31
+GITDIR["python-troveclient"]=$DEST/python-troveclient
32
+
31 33
 TROVE_DIR=$DEST/trove
32
-TROVECLIENT_DIR=$DEST/python-troveclient
33 34
 TROVE_CONF_DIR=/etc/trove
34 35
 TROVE_LOCAL_CONF_DIR=$TROVE_DIR/etc/trove
35 36
 TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
... ...
@@ -109,10 +110,6 @@ function cleanup_trove {
109 109
     rm -fr $TROVE_CONF_DIR/*
110 110
 }
111 111
 
112
-# configure_troveclient() - Set config files, create data dirs, etc
113
-function configure_troveclient {
114
-    setup_develop $TROVECLIENT_DIR
115
-}
116 112
 
117 113
 # configure_trove() - Set config files, create data dirs, etc
118 114
 function configure_trove {
... ...
@@ -184,7 +181,10 @@ function configure_trove {
184 184
 
185 185
 # install_troveclient() - Collect source and prepare
186 186
 function install_troveclient {
187
-    git_clone $TROVECLIENT_REPO $TROVECLIENT_DIR $TROVECLIENT_BRANCH
187
+    if use_library_from_git "python-troveclient"; then
188
+        git_clone_by_name "python-troveclient"
189
+        setup_dev_lib "python-troveclient"
190
+    fi
188 191
 }
189 192
 
190 193
 # install_trove() - Collect source and prepare
... ...
@@ -579,9 +579,6 @@ if [[ -d $TOP_DIR/extras.d ]]; then
579 579
     done
580 580
 fi
581 581
 
582
-# Set the destination directories for other OpenStack projects
583
-OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
584
-
585 582
 # Interactive Configuration
586 583
 # -------------------------
587 584
 
... ...
@@ -783,8 +780,14 @@ fi
783 783
 # Install middleware
784 784
 install_keystonemiddleware
785 785
 
786
-git_clone $OPENSTACKCLIENT_REPO $OPENSTACKCLIENT_DIR $OPENSTACKCLIENT_BRANCH
787
-setup_develop $OPENSTACKCLIENT_DIR
786
+# install the OpenStack client, needed for most setup commands
787
+if use_library_from_git "python-openstackclient"; then
788
+    git_clone_by_name "python-openstackclient"
789
+    setup_dev_lib "python-openstackclient"
790
+else
791
+    pip_install python-openstackclient
792
+fi
793
+
788 794
 
789 795
 if is_service_enabled key; then
790 796
     if [ "$KEYSTONE_AUTH_HOST" == "$SERVICE_HOST" ]; then
... ...
@@ -133,7 +133,7 @@ GIT_BASE=${GIT_BASE:-git://git.openstack.org}
133 133
 CEILOMETER_REPO=${CEILOMETER_REPO:-${GIT_BASE}/openstack/ceilometer.git}
134 134
 CEILOMETER_BRANCH=${CEILOMETER_BRANCH:-stable/juno}
135 135
 
136
-# volume service
136
+# block storage service
137 137
 CINDER_REPO=${CINDER_REPO:-${GIT_BASE}/openstack/cinder.git}
138 138
 CINDER_BRANCH=${CINDER_BRANCH:-stable/juno}
139 139
 
... ...
@@ -165,7 +165,11 @@ NEUTRON_BRANCH=${NEUTRON_BRANCH:-stable/juno}
165 165
 NOVA_REPO=${NOVA_REPO:-${GIT_BASE}/openstack/nova.git}
166 166
 NOVA_BRANCH=${NOVA_BRANCH:-stable/juno}
167 167
 
168
-# storage service
168
+# data processing service
169
+SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git}
170
+SAHARA_BRANCH=${SAHARA_BRANCH:-master}
171
+
172
+# object storage service
169 173
 SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
170 174
 SWIFT_BRANCH=${SWIFT_BRANCH:-stable/juno}
171 175
 
... ...
@@ -188,8 +192,8 @@ TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git}
188 188
 TEMPEST_BRANCH=${TEMPEST_BRANCH:-master}
189 189
 
190 190
 # TODO(sdague): this should end up as a library component like below
191
-TEMPEST_LIB_REPO=${TEMPEST_LIB_REPO:-${GIT_BASE}/openstack/tempest-lib.git}
192
-TEMPEST_LIB_BRANCH=${TEMPEST_LIB_BRANCH:-master}
191
+GITREPO["tempest-lib"]=${TEMPEST_LIB_REPO:-${GIT_BASE}/openstack/tempest-lib.git}
192
+GITBRANCH["tempest-lib"]=${TEMPEST_LIB_BRANCH:-master}
193 193
 
194 194
 
195 195
 ##############
... ...
@@ -199,48 +203,54 @@ TEMPEST_LIB_BRANCH=${TEMPEST_LIB_BRANCH:-master}
199 199
 ##############
200 200
 
201 201
 # ceilometer client library
202
-CEILOMETERCLIENT_REPO=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git}
203
-CEILOMETERCLIENT_BRANCH=${CEILOMETERCLIENT_BRANCH:-master}
202
+GITREPO["python-ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git}
203
+GITBRANCH["python-ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master}
204 204
 
205 205
 # volume client
206
-CINDERCLIENT_REPO=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
207
-CINDERCLIENT_BRANCH=${CINDERCLIENT_BRANCH:-master}
206
+GITREPO["python-cinderclient"]=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
207
+GITBRANCH["python-cinderclient"]=${CINDERCLIENT_BRANCH:-master}
208 208
 
209 209
 # python glance client library
210
-GLANCECLIENT_REPO=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git}
211
-GLANCECLIENT_BRANCH=${GLANCECLIENT_BRANCH:-master}
210
+GITREPO["python-glanceclient"]=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git}
211
+GITBRANCH["python-glanceclient"]=${GLANCECLIENT_BRANCH:-master}
212 212
 
213 213
 # python heat client library
214
-HEATCLIENT_REPO=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git}
215
-HEATCLIENT_BRANCH=${HEATCLIENT_BRANCH:-master}
214
+GITREPO["python-heatclient"]=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git}
215
+GITBRANCH["python-heatclient"]=${HEATCLIENT_BRANCH:-master}
216 216
 
217 217
 # ironic client
218
-IRONICCLIENT_REPO=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git}
219
-IRONICCLIENT_BRANCH=${IRONICCLIENT_BRANCH:-master}
218
+GITREPO["python-ironicclient"]=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git}
219
+GITBRANCH["python-ironicclient"]=${IRONICCLIENT_BRANCH:-master}
220 220
 
221 221
 # python keystone client library to nova that horizon uses
222
-KEYSTONECLIENT_REPO=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git}
223
-KEYSTONECLIENT_BRANCH=${KEYSTONECLIENT_BRANCH:-master}
222
+GITREPO["python-keystoneclient"]=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git}
223
+GITBRANCH["python-keystoneclient"]=${KEYSTONECLIENT_BRANCH:-master}
224 224
 
225 225
 # neutron client
226
-NEUTRONCLIENT_REPO=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
227
-NEUTRONCLIENT_BRANCH=${NEUTRONCLIENT_BRANCH:-master}
226
+GITREPO["python-neutronclient"]=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
227
+GITBRANCH["python-neutronclient"]=${NEUTRONCLIENT_BRANCH:-master}
228 228
 
229 229
 # python client library to nova that horizon (and others) use
230
-NOVACLIENT_REPO=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
231
-NOVACLIENT_BRANCH=${NOVACLIENT_BRANCH:-master}
230
+GITREPO["python-novaclient"]=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
231
+GITBRANCH["python-novaclient"]=${NOVACLIENT_BRANCH:-master}
232
+
233
+# python saharaclient
234
+GITREPO["python-saharaclient"]=${SAHARACLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git}
235
+GITBRANCH["python-saharaclient"]=${SAHARACLIENT_BRANCH:-master}
232 236
 
233 237
 # python swift client library
234
-SWIFTCLIENT_REPO=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git}
235
-SWIFTCLIENT_BRANCH=${SWIFTCLIENT_BRANCH:-master}
238
+GITREPO["python-swiftclient"]=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git}
239
+GITBRANCH["python-swiftclient"]=${SWIFTCLIENT_BRANCH:-master}
236 240
 
237 241
 # trove client library test
238
-TROVECLIENT_REPO=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
239
-TROVECLIENT_BRANCH=${TROVECLIENT_BRANCH:-master}
242
+GITREPO["python-troveclient"]=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
243
+GITBRANCH["python-troveclient"]=${TROVECLIENT_BRANCH:-master}
240 244
 
241 245
 # consolidated openstack python client
242
-OPENSTACKCLIENT_REPO=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
243
-OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master}
246
+GITREPO["python-openstackclient"]=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
247
+GITBRANCH["python-openstackclient"]=${OPENSTACKCLIENT_BRANCH:-master}
248
+# this doesn't exist in a lib file, so set it here
249
+GITDIR["python-openstackclient"]=$DEST/python-openstackclient
244 250
 
245 251
 ###################
246 252
 #
... ...
@@ -319,8 +329,8 @@ GITBRANCH["pbr"]=${PBR_BRANCH:-master}
319 319
 ##################
320 320
 
321 321
 # glance store library
322
-GLANCE_STORE_REPO=${GLANCE_STORE_REPO:-${GIT_BASE}/openstack/glance_store.git}
323
-GLANCE_STORE_BRANCH=${GLANCE_STORE_BRANCH:-master}
322
+GITREPO["glance_store"]=${GLANCE_STORE_REPO:-${GIT_BASE}/openstack/glance_store.git}
323
+GITBRANCH["glance_store"]=${GLANCE_STORE_BRANCH:-master}
324 324
 
325 325
 # heat-cfntools server agent
326 326
 HEAT_CFNTOOLS_REPO=${HEAT_CFNTOOLS_REPO:-${GIT_BASE}/openstack/heat-cfntools.git}
... ...
@@ -331,12 +341,12 @@ HEAT_TEMPLATES_REPO=${HEAT_TEMPLATES_REPO:-${GIT_BASE}/openstack/heat-templates.
331 331
 HEAT_TEMPLATES_BRANCH=${HEAT_TEMPLATES_BRANCH:-master}
332 332
 
333 333
 # django openstack_auth library
334
-HORIZONAUTH_REPO=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git}
335
-HORIZONAUTH_BRANCH=${HORIZONAUTH_BRANCH:-master}
334
+GITREPO["django_openstack_auth"]=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git}
335
+GITBRANCH["django_openstack_auth"]=${HORIZONAUTH_BRANCH:-master}
336 336
 
337 337
 # keystone middleware
338
-KEYSTONEMIDDLEWARE_REPO=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/keystonemiddleware.git}
339
-KEYSTONEMIDDLEWARE_BRANCH=${KEYSTONEMIDDLEWARE_BRANCH:-master}
338
+GITREPO["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/keystonemiddleware.git}
339
+GITBRANCH["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_BRANCH:-master}
340 340
 
341 341
 # s3 support for swift
342 342
 SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/stackforge/swift3.git}
343 343
new file mode 100755
... ...
@@ -0,0 +1,97 @@
0
+#!/usr/bin/env bash
1
+#
2
+# Licensed under the Apache License, Version 2.0 (the "License");
3
+# you may not use this file except in compliance with the License.
4
+# You may obtain a copy of the License at
5
+#
6
+#    http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+# Unless required by applicable law or agreed to in writing, software
9
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+# License for the specific language governing permissions and limitations
12
+# under the License.
13
+
14
+
15
+TOP=$(cd $(dirname "$0")/.. && pwd)
16
+
17
+export TOP_DIR=$TOP
18
+
19
+# Import common functions
20
+source $TOP/functions
21
+source $TOP/stackrc
22
+source $TOP/lib/tls
23
+for i in $TOP/lib/*; do
24
+    if [[ -f $i ]]; then
25
+        source $i
26
+    fi
27
+done
28
+
29
+ALL_LIBS="python-novaclient oslo.config pbr python-troveclient python-keystoneclient taskflow oslo.middleware pycadf python-glanceclient python-ironicclient tempest-lib oslo.messaging oslo.log cliff python-heatclient stevedore python-cinderclient glance_store oslo.concurrency oslo.db oslo.vmware keystonemiddleware oslo.serialization python-saharaclient django_openstack_auth python-openstackclient oslo.rootwrap oslo.i18n python-ceilometerclient oslo.utils python-swiftclient python-neutronclient"
30
+
31
+# Generate the above list with
32
+# echo ${!GITREPO[@]}
33
+# exit 1
34
+
35
+function check_exists {
36
+    local thing=$1
37
+    local hash=$2
38
+    local key=$3
39
+    if [[ ! -z "$VERBOSE" ]]; then
40
+        echo "Checking for $hash[$key]"
41
+    fi
42
+    if [[ -z $thing ]]; then
43
+        echo "$hash[$key] does not exit!"
44
+        exit 1
45
+    else
46
+        if [[ ! -z "$VERBOSE" ]]; then
47
+            echo "$hash[$key] => $thing"
48
+        fi
49
+    fi
50
+}
51
+
52
+function test_all_libs_upto_date {
53
+    # this is all the magics
54
+    local found_libs=${!GITREPO[@]}
55
+    declare -A all_libs
56
+    for lib in $ALL_LIBS; do
57
+        all_libs[$lib]=1
58
+    done
59
+
60
+    for lib in $found_libs; do
61
+        if [[ -z ${all_libs[$lib]} ]]; then
62
+            echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS"
63
+            exit 1
64
+        fi
65
+
66
+    done
67
+    echo "test_all_libs_upto_date PASSED"
68
+}
69
+
70
+function test_libs_exist {
71
+    local lib=""
72
+    for lib in $ALL_LIBS; do
73
+        check_exists "${GITREPO[$lib]}" "GITREPO" "$lib"
74
+        check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib"
75
+        check_exists "${GITDIR[$lib]}" "GITDIR" "$lib"
76
+    done
77
+
78
+    echo "test_libs_exist PASSED"
79
+}
80
+
81
+function test_branch_master {
82
+    for lib in $ALL_LIBS; do
83
+        if [[ ${GITBRANCH[$lib]} != "master" ]]; then
84
+            echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
85
+            exit 1
86
+        fi
87
+    done
88
+
89
+    echo "test_branch_master PASSED"
90
+}
91
+
92
+set -o errexit
93
+
94
+test_libs_exist
95
+test_branch_master
96
+test_all_libs_upto_date