Skip to content

Commit e08ab10

Browse files
committed
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
1 parent 94f8bea commit e08ab10

13 files changed

Lines changed: 84 additions & 74 deletions

File tree

functions-common

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,6 @@ function use_library_from_git {
16151615
return $enabled
16161616
}
16171617

1618-
16191618
# setup a library by name. If we are trying to use the library from
16201619
# git, we'll do a git based install, otherwise we'll punt and the
16211620
# library should be installed by a requirements pull from another
@@ -1626,6 +1625,17 @@ function setup_lib {
16261625
setup_install $dir
16271626
}
16281627

1628+
# setup a library by name in editiable mode. If we are trying to use
1629+
# the library from git, we'll do a git based install, otherwise we'll
1630+
# punt and the library should be installed by a requirements pull from
1631+
# another project.
1632+
#
1633+
# use this for non namespaced libraries
1634+
function setup_dev_lib {
1635+
local name=$1
1636+
local dir=${GITDIR[$name]}
1637+
setup_develop $dir
1638+
}
16291639

16301640
# this should be used if you want to install globally, all libraries should
16311641
# use this, especially *oslo* ones

lib/ceilometer

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set +o xtrace
3535
# --------
3636

3737
# Set up default directories
38-
GITDIR["ceilometerclient"]=$DEST/python-ceilometerclient
38+
GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient
3939

4040
CEILOMETER_DIR=$DEST/ceilometer
4141
CEILOMETER_CONF_DIR=/etc/ceilometer
@@ -269,10 +269,10 @@ function install_ceilometer {
269269

270270
# install_ceilometerclient() - Collect source and prepare
271271
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
276276
fi
277277
}
278278

lib/cinder

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then
3636
fi
3737

3838
# set up default directories
39-
GITDIR["cinderclient"]=$DEST/python-cinderclient
39+
GITDIR["python-cinderclient"]=$DEST/python-cinderclient
4040

4141
CINDER_DIR=$DEST/cinder
4242
CINDER_STATE_PATH=${CINDER_STATE_PATH:=$DATA_DIR/cinder}
@@ -403,10 +403,10 @@ function install_cinder {
403403

404404
# install_cinderclient() - Collect source and prepare
405405
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
410410
fi
411411
}
412412

lib/glance

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set +o xtrace
2727
# --------
2828

2929
# Set up default directories
30-
GITDIR["glanceclient"]=$DEST/python-glanceclient
30+
GITDIR["python-glanceclient"]=$DEST/python-glanceclient
3131

3232
GLANCE_DIR=$DEST/glance
3333
GLANCE_STORE_DIR=$DEST/glance_store
@@ -287,9 +287,9 @@ function init_glance {
287287

288288
# install_glanceclient() - Collect source and prepare
289289
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"
293293
fi
294294
}
295295

lib/heat

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set +o xtrace
2929
# --------
3030

3131
# set up default directories
32-
GITDIR["heatclient"]=$DEST/python-heatclient
32+
GITDIR["python-heatclient"]=$DEST/python-heatclient
3333

3434
HEAT_DIR=$DEST/heat
3535
HEAT_CFNTOOLS_DIR=$DEST/heat-cfntools
@@ -184,10 +184,10 @@ function create_heat_cache_dir {
184184

185185
# install_heatclient() - Collect source and prepare
186186
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
191191
fi
192192
}
193193

lib/ironic

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set +o pipefail
2828
# --------
2929

3030
# Set up default directories
31-
GITDIR["ironicclient"]=$DEST/python-ironicclient
31+
GITDIR["python-ironicclient"]=$DEST/python-ironicclient
3232

3333
IRONIC_DIR=$DEST/ironic
3434
IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent
@@ -151,10 +151,10 @@ function install_ironic {
151151

152152
# install_ironicclient() - Collect sources and prepare
153153
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
158158
else
159159
# nothing actually "requires" ironicclient, so force instally from pypi
160160
pip_install python-ironicclient

lib/keystone

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ set +o xtrace
3333
# --------
3434

3535
# Set up default directories
36-
GITDIR["keystoneclient"]=$DEST/python-keystoneclient
36+
GITDIR["python-keystoneclient"]=$DEST/python-keystoneclient
3737

3838
KEYSTONE_DIR=$DEST/keystone
3939
KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone}
@@ -480,10 +480,10 @@ function init_keystone {
480480

481481
# install_keystoneclient() - Collect source and prepare
482482
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
487487
fi
488488
}
489489

lib/neutron

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fi
6767

6868

6969
# Set up default directories
70-
GITDIR["neutronclient"]=$DEST/python-neutronclient
70+
GITDIR["python-neutronclient"]=$DEST/python-neutronclient
7171

7272

7373
NEUTRON_DIR=$DEST/neutron
@@ -620,10 +620,10 @@ function install_neutron {
620620

621621
# install_neutronclient() - Collect source and prepare
622622
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
627627
fi
628628
}
629629

lib/nova

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set +o xtrace
2929
# --------
3030

3131
# Set up default directories
32-
GITDIR["novaclient"]=$DEST/python-novaclient
32+
GITDIR["python-novaclient"]=$DEST/python-novaclient
3333

3434

3535
NOVA_DIR=$DEST/nova
@@ -639,10 +639,10 @@ function init_nova {
639639

640640
# install_novaclient() - Collect source and prepare
641641
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
646646
fi
647647
}
648648

lib/swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if is_ssl_enabled_service "s-proxy" || is_service_enabled tls-proxy; then
3434
fi
3535

3636
# Set up default directories
37-
GITDIR["swiftclient"]=$DEST/python-swiftclient
37+
GITDIR["python-swiftclient"]=$DEST/python-swiftclient
3838

3939

4040
SWIFT_DIR=$DEST/swift
@@ -677,9 +677,9 @@ function install_swift {
677677
}
678678

679679
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"
683683
fi
684684
}
685685

0 commit comments

Comments
 (0)