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

lfrolov pushed a commit to branch DLAB-1748
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 23a4cf5f44ffba3d748bec5d68ba9bfd70f0c5db
Author: leonidfrolov <frolovl...@gmail.com>
AuthorDate: Thu Jul 9 13:14:40 2020 +0300

    [DLAB-1748]: made changes to apt and pip installation
---
 .../src/general/lib/os/debian/notebook_lib.py                       | 6 +++---
 infrastructure-provisioning/src/general/lib/os/fab.py               | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py 
b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
index 1ad4975..9e45bcb 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -383,11 +383,11 @@ def install_os_pkg(requisites):
             err = sudo('cat 
/tmp/os_install_{}_err.log'.format(os_pkg)).replace('"', "'")
             dep = sudo('cat /tmp/os_install_{}_dep.log'.format(os_pkg))
             dep = dep[len(new_pkgs_parser) : dep.find(" upgraded, ") 
-1].replace('\r', '')\
-                .replace('\n', '').replace('  ', ' 
').replace(os_pkg.split("=")[0], '').strip()
-            if dep == '':
+                .replace('\n', '').replace('  ', ' ').replace(' {} 
'.format(os_pkg.split("=")[0]), ' ').strip()
+            if dep == '' or dep == os_pkg.split("=")[0]:
                 dep = "none"
             else:
-                dep.split(' ')
+                dep = dep.split(' ')
             sudo('apt list --installed | if ! grep {0}/ > 
/tmp/os_install_{1}.list; then  echo "" > 
/tmp/os_install_{1}.list;fi'.format(os_pkg.split("=")[0], os_pkg))
             res = sudo('cat /tmp/os_install_{}.list'.format(os_pkg))
             if res:
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py 
b/infrastructure-provisioning/src/general/lib/os/fab.py
index 18f3d1f..35985b1 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -100,7 +100,7 @@ def install_pip_pkg(requisites, pip_version, lib_group):
                     if versions == '':
                         versions = "none"
                     else:
-                        versions.split(' ')
+                        versions = versions.split(' ')
                     status.append({"group": "{}".format(lib_group), "name": 
pip_pkg.split("==")[0], "status": "failed",
                                    "error_message": err, "available_versions": 
versions})
                 else:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org
For additional commands, e-mail: commits-h...@dlab.apache.org

Reply via email to