Pin pip to latest version with Python2 support for Python 2.7
Change-Id: I5c260e32973908f1d1a34d5ab14ec86cee311e93
Related-Prod: PROD-33981
diff --git a/src/com/mirantis/mk/Python.groovy b/src/com/mirantis/mk/Python.groovy
index 82e9ee3..f009107 100644
--- a/src/com/mirantis/mk/Python.groovy
+++ b/src/com/mirantis/mk/Python.groovy
@@ -34,7 +34,12 @@
sh(returnStdout: true, script: virtualenv_cmd)
if(!offlineDeployment){
try {
- runVirtualenvCommand(path, "pip install -U setuptools pip")
+ def pipPackage = 'pip'
+ if (python == 'python2') {
+ pipPackage = "\"pip<=19.3.1\""
+ common.infoMsg("Pinning pip package due to end of life of Python2 to ${pipPackage} version.")
+ }
+ runVirtualenvCommand(path, "pip install -U setuptools ${pipPackage}")
} catch(Exception e) {
common.warningMsg("Setuptools and pip cannot be updated, you might be offline but OFFLINE_DEPLOYMENT global property not initialized!")
}