From e08ab104e62da041fcc6b2aafba4349326f4a969 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 13 Nov 2014 17:09:28 -0500 Subject: [PATCH] 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 --- functions-common | 12 +++++++++++- lib/ceilometer | 10 +++++----- lib/cinder | 10 +++++----- lib/glance | 8 ++++---- lib/heat | 10 +++++----- lib/ironic | 10 +++++----- lib/keystone | 10 +++++----- lib/neutron | 10 +++++----- lib/nova | 10 +++++----- lib/swift | 8 ++++---- lib/trove | 8 ++++---- stack.sh | 8 ++++---- stackrc | 44 ++++++++++++++++++++++---------------------- 13 files changed, 84 insertions(+), 74 deletions(-) diff --git a/functions-common b/functions-common index 996d79ba6f..e890b75d13 100644 --- a/functions-common +++ b/functions-common @@ -1615,7 +1615,6 @@ function use_library_from_git { return $enabled } - # setup a library by name. 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 @@ -1626,6 +1625,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 eee3e8f35d..c4377e04c0 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -35,7 +35,7 @@ set +o xtrace # -------- # Set up default directories -GITDIR["ceilometerclient"]=$DEST/python-ceilometerclient +GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient CEILOMETER_DIR=$DEST/ceilometer CEILOMETER_CONF_DIR=/etc/ceilometer @@ -269,10 +269,10 @@ function install_ceilometer { # install_ceilometerclient() - Collect source and prepare function install_ceilometerclient { - if use_library_from_git "ceilometerclient"; then - git_clone_by_name "ceilometerclient" - setup_develop "ceilometerclient" - 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 } diff --git a/lib/cinder b/lib/cinder index 56878642e3..eb3cbe86cf 100644 --- a/lib/cinder +++ b/lib/cinder @@ -36,7 +36,7 @@ if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then fi # set up default directories -GITDIR["cinderclient"]=$DEST/python-cinderclient +GITDIR["python-cinderclient"]=$DEST/python-cinderclient CINDER_DIR=$DEST/cinder CINDER_STATE_PATH=${CINDER_STATE_PATH:=$DATA_DIR/cinder} @@ -403,10 +403,10 @@ function install_cinder { # install_cinderclient() - Collect source and prepare function install_cinderclient { - if use_library_from_git "cinderclient"; then - git_clone_by_name "cinderclient" - setup_develop "cinderclient" - 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 } diff --git a/lib/glance b/lib/glance index 8cd48b13f9..3a4ccd8132 100644 --- a/lib/glance +++ b/lib/glance @@ -27,7 +27,7 @@ set +o xtrace # -------- # Set up default directories -GITDIR["glanceclient"]=$DEST/python-glanceclient +GITDIR["python-glanceclient"]=$DEST/python-glanceclient GLANCE_DIR=$DEST/glance GLANCE_STORE_DIR=$DEST/glance_store @@ -287,9 +287,9 @@ function init_glance { # install_glanceclient() - Collect source and prepare function install_glanceclient { - if use_library_from_git "glanceclient"; then - git_clone_by_name "glanceclient" - setup_develop "glanceclient" + if use_library_from_git "python-glanceclient"; then + git_clone_by_name "python-glanceclient" + setup_dev_lib "python-glanceclient" fi } diff --git a/lib/heat b/lib/heat index ed5181b2b8..2b55cf0f6a 100644 --- a/lib/heat +++ b/lib/heat @@ -29,7 +29,7 @@ set +o xtrace # -------- # set up default directories -GITDIR["heatclient"]=$DEST/python-heatclient +GITDIR["python-heatclient"]=$DEST/python-heatclient HEAT_DIR=$DEST/heat HEAT_CFNTOOLS_DIR=$DEST/heat-cfntools @@ -184,10 +184,10 @@ function create_heat_cache_dir { # install_heatclient() - Collect source and prepare function install_heatclient { - if use_library_from_git "heatclient"; then - git_clone_by_name "heatclient" - setup_develop "heatclient" - 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 } diff --git a/lib/ironic b/lib/ironic index c90482a00b..afe69f2df8 100644 --- a/lib/ironic +++ b/lib/ironic @@ -28,7 +28,7 @@ set +o pipefail # -------- # Set up default directories -GITDIR["ironicclient"]=$DEST/python-ironicclient +GITDIR["python-ironicclient"]=$DEST/python-ironicclient IRONIC_DIR=$DEST/ironic IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent @@ -151,10 +151,10 @@ function install_ironic { # install_ironicclient() - Collect sources and prepare function install_ironicclient { - if use_library_from_git "ironicclient"; then - git_clone_by_name "ironicclient" - setup_develop "ironicclient" - 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 diff --git a/lib/keystone b/lib/keystone index 6341ce2eea..e2c823a89e 100644 --- a/lib/keystone +++ b/lib/keystone @@ -33,7 +33,7 @@ set +o xtrace # -------- # Set up default directories -GITDIR["keystoneclient"]=$DEST/python-keystoneclient +GITDIR["python-keystoneclient"]=$DEST/python-keystoneclient KEYSTONE_DIR=$DEST/keystone KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone} @@ -480,10 +480,10 @@ function init_keystone { # install_keystoneclient() - Collect source and prepare function install_keystoneclient { - if use_library_from_git "keystoneclient"; then - git_clone_by_name "keystoneclient" - setup_develop "keystoneclient" - 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 } diff --git a/lib/neutron b/lib/neutron index 8f1bbf2b93..8295a738b7 100644 --- a/lib/neutron +++ b/lib/neutron @@ -67,7 +67,7 @@ fi # Set up default directories -GITDIR["neutronclient"]=$DEST/python-neutronclient +GITDIR["python-neutronclient"]=$DEST/python-neutronclient NEUTRON_DIR=$DEST/neutron @@ -620,10 +620,10 @@ function install_neutron { # install_neutronclient() - Collect source and prepare function install_neutronclient { - if use_library_from_git "neutronclient"; then - git_clone_by_name "neutronclient" - setup_develop "neutronclient" - 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 } diff --git a/lib/nova b/lib/nova index d5f11928e5..78906f7210 100644 --- a/lib/nova +++ b/lib/nova @@ -29,7 +29,7 @@ set +o xtrace # -------- # Set up default directories -GITDIR["novaclient"]=$DEST/python-novaclient +GITDIR["python-novaclient"]=$DEST/python-novaclient NOVA_DIR=$DEST/nova @@ -639,10 +639,10 @@ function init_nova { # install_novaclient() - Collect source and prepare function install_novaclient { - if use_library_from_git "novaclient"; then - git_clone_by_name "novaclient" - setup_develop "novaclient" - 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 } diff --git a/lib/swift b/lib/swift index 801628241a..ae0874ebdf 100644 --- a/lib/swift +++ b/lib/swift @@ -34,7 +34,7 @@ if is_ssl_enabled_service "s-proxy" || is_service_enabled tls-proxy; then fi # Set up default directories -GITDIR["swiftclient"]=$DEST/python-swiftclient +GITDIR["python-swiftclient"]=$DEST/python-swiftclient SWIFT_DIR=$DEST/swift @@ -677,9 +677,9 @@ function install_swift { } function install_swiftclient { - if use_library_from_git "swiftclient"; then - git_clone_by_name "swiftclient" - setup_develop "swiftclient" + if use_library_from_git "python-swiftclient"; then + git_clone_by_name "python-swiftclient" + setup_dev_lib "python-swiftclient" fi } diff --git a/lib/trove b/lib/trove index 50bd684745..60b2bdba22 100644 --- a/lib/trove +++ b/lib/trove @@ -28,7 +28,7 @@ else fi # Set up default configuration -GITDIR["troveclient"]=$DEST/python-troveclient +GITDIR["python-troveclient"]=$DEST/python-troveclient TROVE_DIR=$DEST/trove TROVE_CONF_DIR=/etc/trove @@ -181,9 +181,9 @@ function configure_trove { # install_troveclient() - Collect source and prepare function install_troveclient { - if use_library_from_git "troveclient"; then - git_clone_by_name "troveclient" - setup_develop "troveclient" + if use_library_from_git "python-troveclient"; then + git_clone_by_name "python-troveclient" + setup_dev_lib "python-troveclient" fi } diff --git a/stack.sh b/stack.sh index 2f045119bc..54444ad80c 100755 --- a/stack.sh +++ b/stack.sh @@ -584,7 +584,7 @@ if [[ -d $TOP_DIR/extras.d ]]; then fi # Set the destination directories for other OpenStack projects -GITDIR["openstackclient"]=$DEST/python-openstackclient +GITDIR["python-openstackclient"]=$DEST/python-openstackclient # Interactive Configuration # ------------------------- @@ -788,9 +788,9 @@ fi install_keystonemiddleware # install the OpenStack client, needed for most setup commands -if use_library_from_git "openstackclient"; then - git_clone_by_name "openstackclient" - setup_develop "openstackclient" +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 diff --git a/stackrc b/stackrc index 2f08c730be..c7bad78c0e 100644 --- a/stackrc +++ b/stackrc @@ -210,48 +210,48 @@ GITBRANCH["tempest_lib"]=${TEMPEST_LIB_BRANCH:-master} ############## # ceilometer client library -GITREPO["ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git} -GITBRANCH["ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master} +GITREPO["python-ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git} +GITBRANCH["python-ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master} # volume client -GITREPO["cinderclient"]=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git} -GITBRACH["cinderclient"]=${CINDERCLIENT_BRANCH:-master} +GITREPO["python-cinderclient"]=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git} +GITBRACH["python-cinderclient"]=${CINDERCLIENT_BRANCH:-master} # python glance client library -GITREPO["glanceclient"]=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git} -GITBRANCH["glanceclient"]=${GLANCECLIENT_BRANCH:-master} +GITREPO["python-glanceclient"]=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git} +GITBRANCH["python-glanceclient"]=${GLANCECLIENT_BRANCH:-master} # python heat client library -GITREPO["heatclient"]=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git} -GITBRANCH["heatclient"]=${HEATCLIENT_BRANCH:-master} +GITREPO["python-heatclient"]=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git} +GITBRANCH["python-heatclient"]=${HEATCLIENT_BRANCH:-master} # ironic client -GITREPO["ironicclient"]=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git} -GITBRANCH["ironicclient"]=${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 -GITREPO["keystoneclient"]=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git} -GITBRANCH["keystoneclient"]=${KEYSTONECLIENT_BRANCH:-master} +GITREPO["python-keystoneclient"]=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git} +GITBRANCH["python-keystoneclient"]=${KEYSTONECLIENT_BRANCH:-master} # neutron client -GITREPO["neutronclient"]=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git} -GITBRANCH["neutronclient"]=${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 -GITREPO["novaclient"]=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git} -GITBRANCH["novaclient"]=${NOVACLIENT_BRANCH:-master} +GITREPO["python-novaclient"]=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git} +GITBRANCH["python-novaclient"]=${NOVACLIENT_BRANCH:-master} # python swift client library -GITREPO["swiftclient"]=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git} -GITBRANCH["swiftclient"]=${SWIFTCLIENT_BRANCH:-master} +GITREPO["python-swiftclient"]=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git} +GITBRANCH["python-swiftclient"]=${SWIFTCLIENT_BRANCH:-master} # trove client library test -GITREPO["troveclient"]=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git} -GITBRANCH["troveclient"]=${TROVECLIENT_BRANCH:-master} +GITREPO["python-troveclient"]=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git} +GITBRANCH["python-troveclient"]=${TROVECLIENT_BRANCH:-master} # consolidated openstack python client -GITREPO["openstackclient"]=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git} -GITBRANCH["openstackclient"]=${OPENSTACKCLIENT_BRANCH:-master} +GITREPO["python-openstackclient"]=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git} +GITBRANCH["python-openstackclient"]=${OPENSTACKCLIENT_BRANCH:-master} ################### #