Merge "Refactor uriByProperties MCPArtifactory function"
diff --git a/src/com/mirantis/mcp/MCPArtifactory.groovy b/src/com/mirantis/mcp/MCPArtifactory.groovy
index b272e25..971897e 100644
--- a/src/com/mirantis/mcp/MCPArtifactory.groovy
+++ b/src/com/mirantis/mcp/MCPArtifactory.groovy
@@ -47,13 +47,13 @@
def properties_str = ''
for (int i = 0; i < properties.size(); i++) {
// avoid serialization errors
- key = properties.entrySet().toArray()[i].key
- value = properties.entrySet().toArray()[i].value
- properties_str += "${key}=${value}&"
+ key = properties.entrySet().toArray()[i].key.trim()
+ value = properties.entrySet().toArray()[i].value.trim()
+ properties_str += /${key}=${value}&/
}
def search_url = "${artifactoryURL}/api/search/prop?${properties_str}"
- def result = sh(script: "bash -c \"curl -X GET \'${search_url}\'\"",
+ def result = sh(script: /curl -X GET '${search_url}'/,
returnStdout: true).trim()
def content = new groovy.json.JsonSlurperClassic().parseText(result)
def uri = content.get("results")