Removed offline state checking
Change-Id: I162fd093523965cd6a7c42d307e9e8034c0064ab
diff --git a/src/com/mirantis/mk/Python.groovy b/src/com/mirantis/mk/Python.groovy
index 876299e..e670013 100644
--- a/src/com/mirantis/mk/Python.groovy
+++ b/src/com/mirantis/mk/Python.groovy
@@ -30,10 +30,9 @@
sh(returnStdout: true, script: virtualenv_cmd)
if(!env.getEnvironment().containsKey("OFFLINE_DEPLOYMENT") || !env["OFFLINE_DEPLOYMENT"].toBoolean()){
try {
- //TODO: remove wget after global env prop enforcments
- runVirtualenvCommand(path, "wget -q -T 10 --spider http://google.com && pip install -U setuptools pip")
+ runVirtualenvCommand(path, "pip install -U setuptools pip")
} catch(Exception e) {
- common.warningMsg("Setuptools and pip cannot be updated, you might be offline")
+ common.warningMsg("Setuptools and pip cannot be updated, you might be offline but OFFLINE_DEPLOYMENT global property not initialized!")
}
}
if (reqs_path==null) {
@@ -44,7 +43,7 @@
writeFile file: "${path}/requirements.txt", text: args
reqs_path = "${path}/requirements.txt"
}
- runVirtualenvCommand(path, "pip install -r ${reqs_path}")
+ runVirtualenvCommand(path, "pip install -r ${reqs_path}", true)
}
/**
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index eeda9c4..c7b2d37 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -723,25 +723,9 @@
def python = new com.mirantis.mk.Python()
def dataStr = new groovy.json.JsonBuilder(data).toString()
- //def offlineDeployment = env.getEnvironment().containsKey("OFFLINE_DEPLOYMENT") && env["OFFLINE_DEPLOYMENT"].toBoolean()
- def offlineDeployment = env.getEnvironment().containsKey("OFFLINE_DEPLOYMENT")
- if(!offlineDeployment){
- //TODO: remove wget after global env prop enforcments
- def netcheckResult = sh(script: "wget -q -T 10 --spider http://google.com", returnStatus: true)
- offlineDeployment = netcheckResult != 0 && netcheckResult <= 5
- }else{
- offlineDeployment = env["OFFLINE_DEPLOYMENT"].toBoolean()
- }
- def pepperCmd
-
- if (!offlineDeployment) {
- def pepperCmdFile = "${venv}/pepper-cmd.json"
- writeFile file: pepperCmdFile, text: dataStr
- pepperCmd = "pepper -c ${venv}/pepperrc --make-token -x ${venv}/.peppercache --json-file ${pepperCmdFile}"
- } else {
- common.warningMsg("You might be offline, will use pepper with option --json instead of option --json-file, some complex commands like complicated cmd.runs may not work!")
- pepperCmd = "pepper -c ${venv}/pepperrc --make-token -x ${venv}/.peppercache --json \"" + dataStr.replaceAll('"', '\\\\\\\"') + "\"" // yeah, really 7 backslashes, don't ask why
- }
+ def pepperCmdFile = "${venv}/pepper-cmd.json"
+ writeFile file: pepperCmdFile, text: dataStr
+ def pepperCmd = "pepper -c ${venv}/pepperrc --make-token -x ${venv}/.peppercache --json-file ${pepperCmdFile}"
if (venv) {
output = python.runVirtualenvCommand(venv, pepperCmd, true)