From 54216fb61c9b602703f0160445515f9389cccb5b Mon Sep 17 00:00:00 2001 From: justnoxx Date: Wed, 11 May 2016 13:55:55 +0300 Subject: [PATCH] Fixed validation of configuration parameters at resource template creation. Bumped openstack plugin version. --- build.gradle | 2 +- .../form_scripts/validation/createConfiguration.groovy | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 6da597d..9685ec5 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ repositories { group = "com.electriccloud" description = "Plugins : EC-OpenStack" -version = "1.3.3" +version = "1.3.4" apply plugin: 'groovy' apply plugin: 'flow-gradle-plugin' diff --git a/src/main/resources/project/procedures/form_scripts/validation/createConfiguration.groovy b/src/main/resources/project/procedures/form_scripts/validation/createConfiguration.groovy index 8143654..57001fe 100644 --- a/src/main/resources/project/procedures/form_scripts/validation/createConfiguration.groovy +++ b/src/main/resources/project/procedures/form_scripts/validation/createConfiguration.groovy @@ -215,6 +215,9 @@ def doValidations(args) { COMPUTE_SERVICE_URL, 'Compute Service URL', COMPUTE_SERVICE_VERSION, 'Compute API Version', 'compute', errorList) + debug("Block storage url: " + BLOCK_STORAGE_URL + "\n"); + debug("Block storage version: " + BLOCK_STORAGE_VERSION + "\n"); + validateServiceURLAndVersion(args, serviceEndPoints, BLOCK_STORAGE_URL, 'Block Storage URL', BLOCK_STORAGE_VERSION, 'Block Storage API Version', 'volume', errorList) @@ -379,7 +382,7 @@ private void validateServiceEndpoint(Map serviceEndPoints, if (!serviceUrlValue || !serviceVersionValue) { return } - + debug("ServiceEndPoints: " + serviceEndPoints); def endpointUrls = serviceEndPoints.get(serviceType) if (!endpointUrls) { def error = [:] @@ -390,8 +393,9 @@ private void validateServiceEndpoint(Map serviceEndPoints, } else { //check the specified end-point url and version against the endPointUrls from OpenStack // find the end-point with the version passed in. + debug("Endpoints: " + endpointUrls); String serviceUrlWithMatchingVersion = endpointUrls.find { - it.endsWith("/v$serviceVersionValue") + it == serviceUrlValue + '/v' + serviceVersionValue; } if (!serviceUrlWithMatchingVersion) { //Specified version is not supported