diff --git a/extras.d/70-trove.sh b/extras.d/70-trove.sh index a4dc7fbc5b..f284354e1f 100644 --- a/extras.d/70-trove.sh +++ b/extras.d/70-trove.sh @@ -11,7 +11,6 @@ if is_service_enabled trove; then cleanup_trove elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then echo_summary "Configuring Trove" - configure_troveclient configure_trove if is_service_enabled key; then diff --git a/functions-common b/functions-common index 333f31da02..40ecca5861 100644 --- a/functions-common +++ b/functions-common @@ -1594,6 +1594,17 @@ function setup_lib { setup_install $dir } +# setup a library by name in editiable mode. If we are trying to use +# the library from git, we'll do a git based install, otherwise we'll +# punt and the library should be installed by a requirements pull from +# another project. +# +# use this for non namespaced libraries +function setup_dev_lib { + local name=$1 + local dir=${GITDIR[$name]} + setup_develop $dir +} # this should be used if you want to install globally, all libraries should # use this, especially *oslo* ones diff --git a/lib/ceilometer b/lib/ceilometer index db0c457262..bf5e11f7ef 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -35,8 +35,9 @@ set +o xtrace # -------- # Set up default directories +GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient + CEILOMETER_DIR=$DEST/ceilometer -CEILOMETERCLIENT_DIR=$DEST/python-ceilometerclient CEILOMETER_CONF_DIR=/etc/ceilometer CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api @@ -246,9 +247,11 @@ function install_ceilometer { # install_ceilometerclient() - Collect source and prepare function install_ceilometerclient { - git_clone $CEILOMETERCLIENT_REPO $CEILOMETERCLIENT_DIR $CEILOMETERCLIENT_BRANCH - setup_develop $CEILOMETERCLIENT_DIR - sudo install -D -m 0644 -o $STACK_USER {$CEILOMETERCLIENT_DIR/tools/,/etc/bash_completion.d/}ceilometer.bash_completion + if use_library_from_git "python-ceilometerclient"; then + git_clone_by_name "python-ceilometerclient" + setup_dev_lib "python-ceilometerclient" + sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ceilometerclient"]}/tools/,/etc/bash_completion.d/}ceilometer.bash_completion + fi } # start_ceilometer() - Start running processes, including screen diff --git a/lib/cinder b/lib/cinder index b30a036d16..2504c2e34c 100644 --- a/lib/cinder +++ b/lib/cinder @@ -36,8 +36,9 @@ if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then fi # set up default directories +GITDIR["python-cinderclient"]=$DEST/python-cinderclient + CINDER_DIR=$DEST/cinder -CINDERCLIENT_DIR=$DEST/python-cinderclient CINDER_STATE_PATH=${CINDER_STATE_PATH:=$DATA_DIR/cinder} CINDER_AUTH_CACHE_DIR=${CINDER_AUTH_CACHE_DIR:-/var/cache/cinder} @@ -401,9 +402,11 @@ function install_cinder { # install_cinderclient() - Collect source and prepare function install_cinderclient { - git_clone $CINDERCLIENT_REPO $CINDERCLIENT_DIR $CINDERCLIENT_BRANCH - setup_develop $CINDERCLIENT_DIR - sudo install -D -m 0644 -o $STACK_USER {$CINDERCLIENT_DIR/tools/,/etc/bash_completion.d/}cinder.bash_completion + if use_library_from_git "python-cinderclient"; then + git_clone_by_name "python-cinderclient" + setup_dev_lib "python-cinderclient" + sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-cinderclient"]}/tools/,/etc/bash_completion.d/}cinder.bash_completion + fi } # apply config.d approach for cinder volumes directory diff --git a/lib/glance b/lib/glance index 4194842407..0c1045fd12 100644 --- a/lib/glance +++ b/lib/glance @@ -27,9 +27,10 @@ set +o xtrace # -------- # Set up default directories +GITDIR["python-glanceclient"]=$DEST/python-glanceclient +GITDIR["glance_store"]=$DEST/glance_store + GLANCE_DIR=$DEST/glance -GLANCE_STORE_DIR=$DEST/glance_store -GLANCECLIENT_DIR=$DEST/python-glanceclient GLANCE_CACHE_DIR=${GLANCE_CACHE_DIR:=$DATA_DIR/glance/cache} GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images} GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance} @@ -286,16 +287,20 @@ function init_glance { # install_glanceclient() - Collect source and prepare function install_glanceclient { - git_clone $GLANCECLIENT_REPO $GLANCECLIENT_DIR $GLANCECLIENT_BRANCH - setup_develop $GLANCECLIENT_DIR + if use_library_from_git "python-glanceclient"; then + git_clone_by_name "python-glanceclient" + setup_dev_lib "python-glanceclient" + fi } # install_glance() - Collect source and prepare function install_glance { # Install glance_store from git so we make sure we're testing # the latest code. - git_clone $GLANCE_STORE_REPO $GLANCE_STORE_DIR $GLANCE_STORE_BRANCH - setup_develop $GLANCE_STORE_DIR + if use_library_from_git "glance_store"; then + git_clone_by_name "glance_store" + setup_dev_lib "glance_store" + fi git_clone $GLANCE_REPO $GLANCE_DIR $GLANCE_BRANCH setup_develop $GLANCE_DIR diff --git a/lib/heat b/lib/heat index 53eca25450..2b55cf0f6a 100644 --- a/lib/heat +++ b/lib/heat @@ -29,8 +29,9 @@ set +o xtrace # -------- # set up default directories +GITDIR["python-heatclient"]=$DEST/python-heatclient + HEAT_DIR=$DEST/heat -HEATCLIENT_DIR=$DEST/python-heatclient HEAT_CFNTOOLS_DIR=$DEST/heat-cfntools HEAT_TEMPLATES_REPO_DIR=$DEST/heat-templates HEAT_AUTH_CACHE_DIR=${HEAT_AUTH_CACHE_DIR:-/var/cache/heat} @@ -183,9 +184,11 @@ function create_heat_cache_dir { # install_heatclient() - Collect source and prepare function install_heatclient { - git_clone $HEATCLIENT_REPO $HEATCLIENT_DIR $HEATCLIENT_BRANCH - setup_develop $HEATCLIENT_DIR - sudo install -D -m 0644 -o $STACK_USER {$HEATCLIENT_DIR/tools/,/etc/bash_completion.d/}heat.bash_completion + if use_library_from_git "python-heatclient"; then + git_clone_by_name "python-heatclient" + setup_dev_lib "python-heatclient" + sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-heatclient"]}/tools/,/etc/bash_completion.d/}heat.bash_completion + fi } # install_heat() - Collect source and prepare diff --git a/lib/horizon b/lib/horizon index 755be18f3c..8a509f5afe 100644 --- a/lib/horizon +++ b/lib/horizon @@ -25,8 +25,9 @@ set +o xtrace # -------- # Set up default directories +GITDIR["django_openstack_auth"]=$DEST/django_openstack_auth + HORIZON_DIR=$DEST/horizon -HORIZONAUTH_DIR=$DEST/django_openstack_auth # local_settings.py is used to customize Dashboard settings. # The example file in Horizon repo is used by default. @@ -84,6 +85,12 @@ function cleanup_horizon { # configure_horizon() - Set config files, create data dirs, etc function configure_horizon { setup_develop $HORIZON_DIR + + # Compile message catalogs. + # Horizon is installed as develop mode, so we can compile here. + # Message catalog compilation is handled by Django admin script, + # so compiling them after the installation avoids Django installation twice. + (cd $HORIZON_DIR; ./run_tests.sh -N --compilemessages) } # init_horizon() - Initialize databases, etc. @@ -137,8 +144,16 @@ function init_horizon { # install_django_openstack_auth() - Collect source and prepare function install_django_openstack_auth { - git_clone $HORIZONAUTH_REPO $HORIZONAUTH_DIR $HORIZONAUTH_BRANCH - setup_install $HORIZONAUTH_DIR + if use_library_from_git "django_openstack_auth"; then + local dir=${GITDIR["django_openstack_auth"]} + git_clone_by_name "django_openstack_auth" + # Compile message catalogs before installation + _prepare_message_catalog_compilation + (cd $dir; python setup.py compile_catalog) + setup_dev_lib "django_openstack_auth" + fi + # if we aren't using this library from git, then we just let it + # get dragged in by the horizon setup. } # install_horizon() - Collect source and prepare diff --git a/lib/ironic b/lib/ironic index 5f3ebcd354..8e9c30e2b7 100644 --- a/lib/ironic +++ b/lib/ironic @@ -28,11 +28,12 @@ set +o pipefail # -------- # Set up default directories +GITDIR["python-ironicclient"]=$DEST/python-ironicclient + IRONIC_DIR=$DEST/ironic IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent IRONIC_DATA_DIR=$DATA_DIR/ironic IRONIC_STATE_PATH=/var/lib/ironic -IRONICCLIENT_DIR=$DEST/python-ironicclient IRONIC_AUTH_CACHE_DIR=${IRONIC_AUTH_CACHE_DIR:-/var/cache/ironic} IRONIC_CONF_DIR=${IRONIC_CONF_DIR:-/etc/ironic} IRONIC_CONF_FILE=$IRONIC_CONF_DIR/ironic.conf @@ -150,9 +151,14 @@ function install_ironic { # install_ironicclient() - Collect sources and prepare function install_ironicclient { - git_clone $IRONICCLIENT_REPO $IRONICCLIENT_DIR $IRONICCLIENT_BRANCH - setup_develop $IRONICCLIENT_DIR - sudo install -D -m 0644 -o $STACK_USER {$IRONICCLIENT_DIR/tools/,/etc/bash_completion.d/}ironic.bash_completion + if use_library_from_git "python-ironicclient"; then + git_clone_by_name "python-ironicclient" + setup_dev_lib "python-ironicclient" + sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ironicclient"]}/tools/,/etc/bash_completion.d/}ironic.bash_completion + else + # nothing actually "requires" ironicclient, so force instally from pypi + pip_install python-ironicclient + fi } # _cleanup_ironic_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file diff --git a/lib/keystone b/lib/keystone index 1c67835a12..380b9f1d7d 100644 --- a/lib/keystone +++ b/lib/keystone @@ -33,6 +33,9 @@ set +o xtrace # -------- # Set up default directories +GITDIR["python-keystoneclient"]=$DEST/python-keystoneclient +GITDIR["keystonemiddleware"]=$DEST/keystonemiddleware + KEYSTONE_DIR=$DEST/keystone KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone} KEYSTONE_CONF=$KEYSTONE_CONF_DIR/keystone.conf @@ -44,9 +47,6 @@ else KEYSTONE_WSGI_DIR=${KEYSTONE_WSGI_DIR:-/var/www/keystone} fi -KEYSTONEMIDDLEWARE_DIR=$DEST/keystonemiddleware -KEYSTONECLIENT_DIR=$DEST/python-keystoneclient - # Set up additional extensions, such as oauth1, federation # Example of KEYSTONE_EXTENSIONS=oauth1,federation KEYSTONE_EXTENSIONS=${KEYSTONE_EXTENSIONS:-} @@ -479,15 +479,19 @@ function init_keystone { # install_keystoneclient() - Collect source and prepare function install_keystoneclient { - git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH - setup_develop $KEYSTONECLIENT_DIR - sudo install -D -m 0644 -o $STACK_USER {$KEYSTONECLIENT_DIR/tools/,/etc/bash_completion.d/}keystone.bash_completion + if use_library_from_git "python-keystoneclient"; then + git_clone_by_name "python-keystoneclient" + setup_dev_lib "python-keystoneclient" + sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-keystoneclient"]}/tools/,/etc/bash_completion.d/}keystone.bash_completion + fi } # install_keystonemiddleware() - Collect source and prepare function install_keystonemiddleware { - git_clone $KEYSTONEMIDDLEWARE_REPO $KEYSTONEMIDDLEWARE_DIR $KEYSTONEMIDDLEWARE_BRANCH - setup_install $KEYSTONEMIDDLEWARE_DIR + if use_library_from_git "keystonemiddleware"; then + git_clone_by_name "keystonemiddleware" + setup_dev_lib "keystonemiddleware" + fi } # install_keystone() - Collect source and prepare diff --git a/lib/neutron b/lib/neutron index ca9b16cd8c..02aaeef529 100644 --- a/lib/neutron +++ b/lib/neutron @@ -75,8 +75,10 @@ fi # Set up default directories +GITDIR["python-neutronclient"]=$DEST/python-neutronclient + + NEUTRON_DIR=$DEST/neutron -NEUTRONCLIENT_DIR=$DEST/python-neutronclient NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron} # Support entry points installation of console scripts @@ -599,9 +601,11 @@ function install_neutron { # install_neutronclient() - Collect source and prepare function install_neutronclient { - git_clone $NEUTRONCLIENT_REPO $NEUTRONCLIENT_DIR $NEUTRONCLIENT_BRANCH - setup_develop $NEUTRONCLIENT_DIR - sudo install -D -m 0644 -o $STACK_USER {$NEUTRONCLIENT_DIR/tools/,/etc/bash_completion.d/}neutron.bash_completion + if use_library_from_git "python-neutronclient"; then + git_clone_by_name "python-neutronclient" + setup_dev_lib "python-neutronclient" + sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-neutronclient"]}/tools/,/etc/bash_completion.d/}neutron.bash_completion + fi } # install_neutron_agent_packages() - Collect source and prepare diff --git a/lib/nova b/lib/nova index f47dc9798c..01d50ebd63 100644 --- a/lib/nova +++ b/lib/nova @@ -29,8 +29,10 @@ set +o xtrace # -------- # Set up default directories +GITDIR["python-novaclient"]=$DEST/python-novaclient + + NOVA_DIR=$DEST/nova -NOVACLIENT_DIR=$DEST/python-novaclient NOVA_STATE_PATH=${NOVA_STATE_PATH:=$DATA_DIR/nova} # INSTANCES_PATH is the previous name for this NOVA_INSTANCES_PATH=${NOVA_INSTANCES_PATH:=${INSTANCES_PATH:=$NOVA_STATE_PATH/instances}} @@ -631,9 +633,11 @@ function init_nova { # install_novaclient() - Collect source and prepare function install_novaclient { - git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH - setup_develop $NOVACLIENT_DIR - sudo install -D -m 0644 -o $STACK_USER {$NOVACLIENT_DIR/tools/,/etc/bash_completion.d/}nova.bash_completion + if use_library_from_git "python-novaclient"; then + git_clone_by_name "python-novaclient" + setup_dev_lib "python-novaclient" + sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-novaclient"]}/tools/,/etc/bash_completion.d/}nova.bash_completion + fi } # install_nova() - Collect source and prepare diff --git a/lib/sahara b/lib/sahara index 233c7621ae..79591c91af 100644 --- a/lib/sahara +++ b/lib/sahara @@ -21,16 +21,9 @@ set +o xtrace # Defaults # -------- -# Set up default repos -SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git} -SAHARA_BRANCH=${SAHARA_BRANCH:-stable/juno} - -SAHARA_PYTHONCLIENT_REPO=${SAHARA_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git} -SAHARA_PYTHONCLIENT_BRANCH=${SAHARA_PYTHONCLIENT_BRANCH:-master} - # Set up default directories +GITDIR["python-saharaclient"]=$DEST/python-saharaclient SAHARA_DIR=$DEST/sahara -SAHARA_PYTHONCLIENT_DIR=$DEST/python-saharaclient SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara} SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf @@ -153,8 +146,10 @@ function install_sahara { # install_python_saharaclient() - Collect source and prepare function install_python_saharaclient { - git_clone $SAHARA_PYTHONCLIENT_REPO $SAHARA_PYTHONCLIENT_DIR $SAHARA_PYTHONCLIENT_BRANCH - setup_develop $SAHARA_PYTHONCLIENT_DIR + if use_library_from_git "python-saharaclient"; then + git_clone_by_name "python-saharaclient" + setup_dev_lib "python-saharaclient" + fi } # start_sahara() - Start running processes, including screen diff --git a/lib/swift b/lib/swift index 2bf45e4a5e..a7b7f2836e 100644 --- a/lib/swift +++ b/lib/swift @@ -34,8 +34,10 @@ if is_ssl_enabled_service "s-proxy" || is_service_enabled tls-proxy; then fi # Set up default directories +GITDIR["python-swiftclient"]=$DEST/python-swiftclient + + SWIFT_DIR=$DEST/swift -SWIFTCLIENT_DIR=$DEST/python-swiftclient SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift} SWIFT_APACHE_WSGI_DIR=${SWIFT_APACHE_WSGI_DIR:-/var/www/swift} SWIFT3_DIR=$DEST/swift3 @@ -654,8 +656,10 @@ function install_swift { } function install_swiftclient { - git_clone $SWIFTCLIENT_REPO $SWIFTCLIENT_DIR $SWIFTCLIENT_BRANCH - setup_develop $SWIFTCLIENT_DIR + if use_library_from_git "python-swiftclient"; then + git_clone_by_name "python-swiftclient" + setup_dev_lib "python-swiftclient" + fi } # start_swift() - Start running processes, including screen diff --git a/lib/tempest b/lib/tempest index a08bcd17fd..46a33ac6e7 100644 --- a/lib/tempest +++ b/lib/tempest @@ -44,11 +44,12 @@ set +o xtrace # -------- # Set up default directories +GITDIR["tempest-lib"]=$DEST/tempest-lib + TEMPEST_DIR=$DEST/tempest TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc} TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest} -TEMPEST_LIB_DIR=$DEST/tempest-lib NOVA_SOURCE_DIR=$DEST/nova @@ -433,8 +434,10 @@ function create_tempest_accounts { # install_tempest_lib() - Collect source, prepare, and install tempest-lib function install_tempest_lib { - git_clone $TEMPEST_LIB_REPO $TEMPEST_LIB_DIR $TEMPEST_LIB_BRANCH - setup_develop $TEMPEST_LIB_DIR + if use_library_from_git "tempest-lib"; then + git_clone_by_name "tempest-lib" + setup_dev_lib "tempest-lib" + fi } # install_tempest() - Collect source and prepare diff --git a/lib/trove b/lib/trove index 1d1b5f406b..cd38d111ca 100644 --- a/lib/trove +++ b/lib/trove @@ -28,8 +28,9 @@ else fi # Set up default configuration +GITDIR["python-troveclient"]=$DEST/python-troveclient + TROVE_DIR=$DEST/trove -TROVECLIENT_DIR=$DEST/python-troveclient TROVE_CONF_DIR=/etc/trove TROVE_LOCAL_CONF_DIR=$TROVE_DIR/etc/trove TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove} @@ -109,10 +110,6 @@ function cleanup_trove { rm -fr $TROVE_CONF_DIR/* } -# configure_troveclient() - Set config files, create data dirs, etc -function configure_troveclient { - setup_develop $TROVECLIENT_DIR -} # configure_trove() - Set config files, create data dirs, etc function configure_trove { @@ -184,7 +181,10 @@ function configure_trove { # install_troveclient() - Collect source and prepare function install_troveclient { - git_clone $TROVECLIENT_REPO $TROVECLIENT_DIR $TROVECLIENT_BRANCH + if use_library_from_git "python-troveclient"; then + git_clone_by_name "python-troveclient" + setup_dev_lib "python-troveclient" + fi } # install_trove() - Collect source and prepare diff --git a/stack.sh b/stack.sh index 3b5fb7459b..d8ba203a50 100755 --- a/stack.sh +++ b/stack.sh @@ -579,9 +579,6 @@ if [[ -d $TOP_DIR/extras.d ]]; then done fi -# Set the destination directories for other OpenStack projects -OPENSTACKCLIENT_DIR=$DEST/python-openstackclient - # Interactive Configuration # ------------------------- @@ -783,8 +780,14 @@ fi # Install middleware install_keystonemiddleware -git_clone $OPENSTACKCLIENT_REPO $OPENSTACKCLIENT_DIR $OPENSTACKCLIENT_BRANCH -setup_develop $OPENSTACKCLIENT_DIR +# install the OpenStack client, needed for most setup commands +if use_library_from_git "python-openstackclient"; then + git_clone_by_name "python-openstackclient" + setup_dev_lib "python-openstackclient" +else + pip_install python-openstackclient +fi + if is_service_enabled key; then if [ "$KEYSTONE_AUTH_HOST" == "$SERVICE_HOST" ]; then diff --git a/stackrc b/stackrc index 4ee472a284..9b0c394db8 100644 --- a/stackrc +++ b/stackrc @@ -133,7 +133,7 @@ GIT_BASE=${GIT_BASE:-git://git.openstack.org} CEILOMETER_REPO=${CEILOMETER_REPO:-${GIT_BASE}/openstack/ceilometer.git} CEILOMETER_BRANCH=${CEILOMETER_BRANCH:-stable/juno} -# volume service +# block storage service CINDER_REPO=${CINDER_REPO:-${GIT_BASE}/openstack/cinder.git} CINDER_BRANCH=${CINDER_BRANCH:-stable/juno} @@ -165,7 +165,11 @@ NEUTRON_BRANCH=${NEUTRON_BRANCH:-stable/juno} NOVA_REPO=${NOVA_REPO:-${GIT_BASE}/openstack/nova.git} NOVA_BRANCH=${NOVA_BRANCH:-stable/juno} -# storage service +# data processing service +SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git} +SAHARA_BRANCH=${SAHARA_BRANCH:-master} + +# object storage service SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git} SWIFT_BRANCH=${SWIFT_BRANCH:-stable/juno} @@ -188,8 +192,8 @@ TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git} TEMPEST_BRANCH=${TEMPEST_BRANCH:-master} # TODO(sdague): this should end up as a library component like below -TEMPEST_LIB_REPO=${TEMPEST_LIB_REPO:-${GIT_BASE}/openstack/tempest-lib.git} -TEMPEST_LIB_BRANCH=${TEMPEST_LIB_BRANCH:-master} +GITREPO["tempest-lib"]=${TEMPEST_LIB_REPO:-${GIT_BASE}/openstack/tempest-lib.git} +GITBRANCH["tempest-lib"]=${TEMPEST_LIB_BRANCH:-master} ############## @@ -199,48 +203,54 @@ TEMPEST_LIB_BRANCH=${TEMPEST_LIB_BRANCH:-master} ############## # ceilometer client library -CEILOMETERCLIENT_REPO=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git} -CEILOMETERCLIENT_BRANCH=${CEILOMETERCLIENT_BRANCH:-master} +GITREPO["python-ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git} +GITBRANCH["python-ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master} # volume client -CINDERCLIENT_REPO=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git} -CINDERCLIENT_BRANCH=${CINDERCLIENT_BRANCH:-master} +GITREPO["python-cinderclient"]=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git} +GITBRANCH["python-cinderclient"]=${CINDERCLIENT_BRANCH:-master} # python glance client library -GLANCECLIENT_REPO=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git} -GLANCECLIENT_BRANCH=${GLANCECLIENT_BRANCH:-master} +GITREPO["python-glanceclient"]=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git} +GITBRANCH["python-glanceclient"]=${GLANCECLIENT_BRANCH:-master} # python heat client library -HEATCLIENT_REPO=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git} -HEATCLIENT_BRANCH=${HEATCLIENT_BRANCH:-master} +GITREPO["python-heatclient"]=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git} +GITBRANCH["python-heatclient"]=${HEATCLIENT_BRANCH:-master} # ironic client -IRONICCLIENT_REPO=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git} -IRONICCLIENT_BRANCH=${IRONICCLIENT_BRANCH:-master} +GITREPO["python-ironicclient"]=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git} +GITBRANCH["python-ironicclient"]=${IRONICCLIENT_BRANCH:-master} # python keystone client library to nova that horizon uses -KEYSTONECLIENT_REPO=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git} -KEYSTONECLIENT_BRANCH=${KEYSTONECLIENT_BRANCH:-master} +GITREPO["python-keystoneclient"]=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git} +GITBRANCH["python-keystoneclient"]=${KEYSTONECLIENT_BRANCH:-master} # neutron client -NEUTRONCLIENT_REPO=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git} -NEUTRONCLIENT_BRANCH=${NEUTRONCLIENT_BRANCH:-master} +GITREPO["python-neutronclient"]=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git} +GITBRANCH["python-neutronclient"]=${NEUTRONCLIENT_BRANCH:-master} # python client library to nova that horizon (and others) use -NOVACLIENT_REPO=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git} -NOVACLIENT_BRANCH=${NOVACLIENT_BRANCH:-master} +GITREPO["python-novaclient"]=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git} +GITBRANCH["python-novaclient"]=${NOVACLIENT_BRANCH:-master} + +# python saharaclient +GITREPO["python-saharaclient"]=${SAHARACLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git} +GITBRANCH["python-saharaclient"]=${SAHARACLIENT_BRANCH:-master} # python swift client library -SWIFTCLIENT_REPO=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git} -SWIFTCLIENT_BRANCH=${SWIFTCLIENT_BRANCH:-master} +GITREPO["python-swiftclient"]=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git} +GITBRANCH["python-swiftclient"]=${SWIFTCLIENT_BRANCH:-master} # trove client library test -TROVECLIENT_REPO=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git} -TROVECLIENT_BRANCH=${TROVECLIENT_BRANCH:-master} +GITREPO["python-troveclient"]=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git} +GITBRANCH["python-troveclient"]=${TROVECLIENT_BRANCH:-master} # consolidated openstack python client -OPENSTACKCLIENT_REPO=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git} -OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master} +GITREPO["python-openstackclient"]=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git} +GITBRANCH["python-openstackclient"]=${OPENSTACKCLIENT_BRANCH:-master} +# this doesn't exist in a lib file, so set it here +GITDIR["python-openstackclient"]=$DEST/python-openstackclient ################### # @@ -319,8 +329,8 @@ GITBRANCH["pbr"]=${PBR_BRANCH:-master} ################## # glance store library -GLANCE_STORE_REPO=${GLANCE_STORE_REPO:-${GIT_BASE}/openstack/glance_store.git} -GLANCE_STORE_BRANCH=${GLANCE_STORE_BRANCH:-master} +GITREPO["glance_store"]=${GLANCE_STORE_REPO:-${GIT_BASE}/openstack/glance_store.git} +GITBRANCH["glance_store"]=${GLANCE_STORE_BRANCH:-master} # heat-cfntools server agent 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. HEAT_TEMPLATES_BRANCH=${HEAT_TEMPLATES_BRANCH:-master} # django openstack_auth library -HORIZONAUTH_REPO=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git} -HORIZONAUTH_BRANCH=${HORIZONAUTH_BRANCH:-master} +GITREPO["django_openstack_auth"]=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git} +GITBRANCH["django_openstack_auth"]=${HORIZONAUTH_BRANCH:-master} # keystone middleware -KEYSTONEMIDDLEWARE_REPO=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/keystonemiddleware.git} -KEYSTONEMIDDLEWARE_BRANCH=${KEYSTONEMIDDLEWARE_BRANCH:-master} +GITREPO["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/keystonemiddleware.git} +GITBRANCH["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_BRANCH:-master} # s3 support for swift SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/stackforge/swift3.git} diff --git a/tests/test_libs_from_pypi.sh b/tests/test_libs_from_pypi.sh new file mode 100755 index 0000000000..8c0fc249fd --- /dev/null +++ b/tests/test_libs_from_pypi.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +TOP=$(cd $(dirname "$0")/.. && pwd) + +export TOP_DIR=$TOP + +# Import common functions +source $TOP/functions +source $TOP/stackrc +source $TOP/lib/tls +for i in $TOP/lib/*; do + if [[ -f $i ]]; then + source $i + fi +done + +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" + +# Generate the above list with +# echo ${!GITREPO[@]} +# exit 1 + +function check_exists { + local thing=$1 + local hash=$2 + local key=$3 + if [[ ! -z "$VERBOSE" ]]; then + echo "Checking for $hash[$key]" + fi + if [[ -z $thing ]]; then + echo "$hash[$key] does not exit!" + exit 1 + else + if [[ ! -z "$VERBOSE" ]]; then + echo "$hash[$key] => $thing" + fi + fi +} + +function test_all_libs_upto_date { + # this is all the magics + local found_libs=${!GITREPO[@]} + declare -A all_libs + for lib in $ALL_LIBS; do + all_libs[$lib]=1 + done + + for lib in $found_libs; do + if [[ -z ${all_libs[$lib]} ]]; then + echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS" + exit 1 + fi + + done + echo "test_all_libs_upto_date PASSED" +} + +function test_libs_exist { + local lib="" + for lib in $ALL_LIBS; do + check_exists "${GITREPO[$lib]}" "GITREPO" "$lib" + check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib" + check_exists "${GITDIR[$lib]}" "GITDIR" "$lib" + done + + echo "test_libs_exist PASSED" +} + +function test_branch_master { + for lib in $ALL_LIBS; do + if [[ ${GITBRANCH[$lib]} != "master" ]]; then + echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})" + exit 1 + fi + done + + echo "test_branch_master PASSED" +} + +set -o errexit + +test_libs_exist +test_branch_master +test_all_libs_upto_date