You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2021/04/13 07:25:31 UTC

[incubator-datalab] 03/04: [DATALAB-2091]: corrected invalid name and invalid version handling

This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DATALAB-2091
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit d5dfde23f118be09291c6462b6fa418b27622989
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Mon Apr 12 17:49:47 2021 +0300

    [DATALAB-2091]: corrected invalid name and invalid version handling
---
 infrastructure-provisioning/src/general/lib/os/fab.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 7287064..06842c9 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -76,7 +76,7 @@ def install_pip_pkg(requisites, pip_version, lib_group):
                 pip_pkg = "{}=={}".format(pip_pkg[0], pip_pkg[1])
             conn.sudo('{0} install -U {1} --no-cache-dir 2>&1 | tee /tmp/tee.tmp; if ! grep -w -i -E  "({2})" /tmp/tee.tmp > '
                  ' /tmp/{0}install_{3}.log; then  echo "" > /tmp/{0}install_{3}.log;fi'.format(pip_version, pip_pkg, error_parser, name))
-            err = conn.sudo('cat /tmp/{0}install_{1}.log'.format(pip_version, pip_pkg.split("==")[0])).stdout.replace('"', "'").replace('\n', '')
+            err = conn.sudo('cat /tmp/{0}install_{1}.log'.format(pip_version, pip_pkg.split("==")[0])).stdout.replace('"', "'").replace('\n', ' ')
             conn.sudo('{0} freeze --all | if ! grep -w -i {1} > /tmp/{0}install_{1}.list; then  echo "not_found" > /tmp/{0}install_{1}.list;fi'.format(pip_version, name))
             res = conn.sudo('cat /tmp/{0}install_{1}.list'.format(pip_version, name)).stdout.replace('\n', '')
             conn.sudo('cat /tmp/tee.tmp | if ! grep "Successfully installed" > /tmp/{0}install_{1}.list; then  echo "not_installed" > /tmp/{0}install_{1}.list;fi'.format(pip_version, name))
@@ -103,7 +103,7 @@ def install_pip_pkg(requisites, pip_version, lib_group):
                     [i for i in ver if pip_pkg.split("==")[0].lower() in i][0].split('==')[1]
                 status_msg = "installed"
             versions = []
-            if 'Could not find a version that satisfies the requirement' in err:
+            if 'Could not find a version that satisfies the requirement' in err and 'ERROR: No matching distribution found for {}=='.format(name) in err:
                 versions = err[err.find("(from versions: ") + 16: err.find(")\r\n")]
                 if versions != '' and versions != 'none':
                     versions = versions.split(', ')

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org