diff --git a/src/com/mirantis/mcp/MCPArtifactory.groovy b/src/com/mirantis/mcp/MCPArtifactory.groovy
index b272e25..0101eb8 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")
@@ -280,7 +280,7 @@
              passwordVariable: 'ARTIFACTORY_PASSWORD',
              usernameVariable: 'ARTIFACTORY_LOGIN']
     ]) {
-        sh "bash -c \"curl  -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} -H \"Content-Type:application/json\" -X POST -d @${queryFile} ${url}\""
+        sh "bash -c \"curl --fail -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} -H \"Content-Type:application/json\" -X POST -d @${queryFile} ${url}\""
     }
     sh "rm -v ${queryFile}"
 }
diff --git a/src/com/mirantis/mcp/Validate.groovy b/src/com/mirantis/mcp/Validate.groovy
index 02030e0..d1188de 100644
--- a/src/com/mirantis/mcp/Validate.groovy
+++ b/src/com/mirantis/mcp/Validate.groovy
@@ -469,15 +469,21 @@
                        conf_script_path="", ext_variables = []) {
     def salt = new com.mirantis.mk.Salt()
     if (testing_tools_repo != "" ) {
-        salt.cmdRun(master, target, "docker exec cvp git clone ${testing_tools_repo} cvp-configuration")
-        configure_script = conf_script_path != "" ? conf_script_path : "cvp-configuration/configure.sh"
-    } else {
-        configure_script = conf_script_path != "" ? conf_script_path : "/opt/devops-qa-tools/deployment/configure.sh"
+        if (testing_tools_repo.contains('http://') || testing_tools_repo.contains('https://')) {
+            salt.cmdRun(master, target, "docker exec cvp git clone ${testing_tools_repo} cvp-configuration")
+            configure_script = conf_script_path != "" ? conf_script_path : "cvp-configuration/configure.sh"
+        }
+        else {
+            configure_script = testing_tools_repo
+        }
+        ext_variables.addAll("PROXY=${proxy}", "TEMPEST_REPO=${tempest_repo}",
+                             "TEMPEST_ENDPOINT_TYPE=${tempest_endpoint_type}",
+                             "tempest_version=${tempest_version}")
+        salt.cmdRun(master, target, "docker exec -e " + ext_variables.join(' -e ') + " cvp bash -c ${configure_script}")
     }
-    ext_variables.addAll("PROXY=${proxy}", "TEMPEST_REPO=${tempest_repo}",
-                         "TEMPEST_ENDPOINT_TYPE=${tempest_endpoint_type}",
-                         "tempest_version=${tempest_version}")
-    salt.cmdRun(master, target, "docker exec -e " + ext_variables.join(' -e ') + " cvp bash -c ${configure_script}")
+    else {
+        common.infoMsg("TOOLS_REPO is empty, no confguration is needed for container")
+    }
 }
 
 /**
@@ -669,10 +675,22 @@
             repo_name = repo_url.tokenize()[0].tokenize("/").last()
         }
     }
+    path_venv = "${env.WORKSPACE}/venv"
+    path_req = "${env.WORKSPACE}/${repo_name}/requirements.txt"
     sh "rm -rf ${repo_name}"
-    withEnv(["HTTPS_PROXY=${proxy}", "HTTP_PROXY=${proxy}", "https_proxy=${proxy}", "http_proxy=${proxy}"]) {
+    // this is temporary W/A for offline deployments
+    // Jenkins slave image has /opt/pip-mirror/ folder
+    // where pip wheels for cvp projects are located
+    if (proxy != 'offline') {
+        withEnv(["HTTPS_PROXY=${proxy}", "HTTP_PROXY=${proxy}", "https_proxy=${proxy}", "http_proxy=${proxy}"]) {
+            sh "git clone ${repo_url}"
+            python.setupVirtualenv(path_venv, "python2", [], path_req, true)
+        }
+    }
+    else {
         sh "git clone ${repo_url}"
-        python.setupVirtualenv("${env.WORKSPACE}/venv", "python2", [], "${env.WORKSPACE}/${repo_name}/requirements.txt", true)
+        sh "virtualenv ${path_venv} --python python2"
+        python.runVirtualenvCommand(path_venv, "pip install --no-index --find-links=/opt/pip-mirror/ -r ${path_req}", true)
     }
 }
 
