Refactoring in salt and python utils for offline deployment

Change-Id: I183b56a6eafb715aae2e896ff8bb1d3da79760d1
diff --git a/src/com/mirantis/mk/Python.groovy b/src/com/mirantis/mk/Python.groovy
index e5a6023..ebb6fc9 100644
--- a/src/com/mirantis/mk/Python.groovy
+++ b/src/com/mirantis/mk/Python.groovy
@@ -28,10 +28,13 @@
 
     common.infoMsg("[Python ${path}] Setup ${python} environment")
     sh(returnStdout: true, script: virtualenv_cmd)
-    try {
-        runVirtualenvCommand(path, "wget -q -T 3 --spider http://google.com && pip install -U setuptools pip")
-    } catch(Exception e) {
-        common.warningMsg("Setuptools and pip cannot be updated, you might be offline")
+    if(!env.getEnvironment().containsKey("OFFLINE_DEPLOYMENT") || !env["OFFLINE_DEPLOYMENT"].toBoolean()){
+      try {
+          //TODO: remove wget after global env prop enforcments
+          runVirtualenvCommand(path, "wget -q -T 3 --spider http://google.com && pip install -U setuptools pip")
+      } catch(Exception e) {
+          common.warningMsg("Setuptools and pip cannot be updated, you might be offline")
+      }
     }
     if (reqs_path==null) {
         def args = ""