Add a flexible API version choice for Cinder, Glance and Heat

The version of the authentication url is set to v1.0 for some
projects by default. We can make it configurable via the parameter
"$IDENTITY_API_VERSION".

Closes-Bug: #1253539
Change-Id: I6640e345d1317b1308403c95b13f8a998320241b
diff --git a/lib/keystone b/lib/keystone
index 29b9604..79f1fd9 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -335,6 +335,14 @@
     fi
 }
 
+# Configure the API version for the OpenStack projects.
+# configure_API_version conf_file version
+function configure_API_version() {
+    local conf_file=$1
+    local api_version=$2
+    iniset $conf_file keystone_authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$api_version
+}
+
 # init_keystone() - Initialize databases, etc.
 function init_keystone() {
     if is_service_enabled ldap; then