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
diff --git a/functions-common b/functions-common
index 996d79b..e890b75 100644
--- a/functions-common
+++ b/functions-common
@@ -1615,7 +1615,6 @@
     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 @@
     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 eee3e8f..c4377e0 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -35,7 +35,7 @@
 # --------
 
 # 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 @@
 
 # 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 5687864..eb3cbe8 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -36,7 +36,7 @@
 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 @@
 
 # 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 8cd48b1..3a4ccd8 100644
--- a/lib/glance
+++ b/lib/glance
@@ -27,7 +27,7 @@
 # --------
 
 # 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 @@
 
 # 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 ed5181b..2b55cf0 100644
--- a/lib/heat
+++ b/lib/heat
@@ -29,7 +29,7 @@
 # --------
 
 # 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 @@
 
 # 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 c90482a..afe69f2 100644
--- a/lib/ironic
+++ b/lib/ironic
@@ -28,7 +28,7 @@
 # --------
 
 # 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 @@
 
 # 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 6341ce2..e2c823a 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -33,7 +33,7 @@
 # --------
 
 # 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 @@
 
 # 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 8f1bbf2..8295a73 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -67,7 +67,7 @@
 
 
 # Set up default directories
-GITDIR["neutronclient"]=$DEST/python-neutronclient
+GITDIR["python-neutronclient"]=$DEST/python-neutronclient
 
 
 NEUTRON_DIR=$DEST/neutron
@@ -620,10 +620,10 @@
 
 # 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 d5f1192..78906f7 100644
--- a/lib/nova
+++ b/lib/nova
@@ -29,7 +29,7 @@
 # --------
 
 # Set up default directories
-GITDIR["novaclient"]=$DEST/python-novaclient
+GITDIR["python-novaclient"]=$DEST/python-novaclient
 
 
 NOVA_DIR=$DEST/nova
@@ -639,10 +639,10 @@
 
 # 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 8016282..ae0874e 100644
--- a/lib/swift
+++ b/lib/swift
@@ -34,7 +34,7 @@
 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_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 50bd684..60b2bdb 100644
--- a/lib/trove
+++ b/lib/trove
@@ -28,7 +28,7 @@
 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 @@
 
 # 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 2f04511..54444ad 100755
--- a/stack.sh
+++ b/stack.sh
@@ -584,7 +584,7 @@
 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 @@
 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 2f08c73..c7bad78 100644
--- a/stackrc
+++ b/stackrc
@@ -210,48 +210,48 @@
 ##############
 
 # 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}
 
 ###################
 #