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
The following commit(s) were added to refs/heads/DLAB-1748 by this push:
new 5b4c4e5 [DLAB-1748]: made changes to apt and pip installation status
5b4c4e5 is described below
commit 5b4c4e5e4b4afd643a9f1af7ed89134dee0ab67d
Author: leonidfrolov <[email protected]>
AuthorDate: Thu Jul 9 14:36:46 2020 +0300
[DLAB-1748]: made changes to apt and pip installation status
---
.../src/general/lib/os/debian/notebook_lib.py | 4 ++--
infrastructure-provisioning/src/general/lib/os/fab.py | 17 +++++++----------
2 files changed, 9 insertions(+), 12 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 9e45bcb..c97ccb8 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -385,7 +385,7 @@ def install_os_pkg(requisites):
dep = dep[len(new_pkgs_parser) : dep.find(" upgraded, ")
-1].replace('\r', '')\
.replace('\n', '').replace(' ', ' ').replace(' {}
'.format(os_pkg.split("=")[0]), ' ').strip()
if dep == '' or dep == os_pkg.split("=")[0]:
- dep = "none"
+ dep = []
else:
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))
@@ -396,7 +396,7 @@ def install_os_pkg(requisites):
version = [i for i in ver if os_pkg.split("=")[0] in
i][0].split(' ')[1]
status.append({"group": "os_pkg", "name":
os_pkg.split("=")[0], "version": version, "status": "installed", "add_pkgs":
dep})
else:
- status.append({"group": "os_pkg", "name":
os_pkg.split("=")[0], "status": "failed", "error_message": err})
+ status.append({"group": "os_pkg", "name":
os_pkg.split("=")[0], "status": "failed", "error_message": err,
"available_versions": []})
sudo('unattended-upgrades -v')
sudo('export LC_ALL=C')
return status
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py
b/infrastructure-provisioning/src/general/lib/os/fab.py
index 35985b1..d128fda 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -90,21 +90,18 @@ def install_pip_pkg(requisites, pip_version, lib_group):
dep = sudo('{0} show {1} 2>&1 | grep "Requires:
"'.format(pip_version, pip_pkg.split("==")[0])).replace(
'\r', '').replace('\n', '').replace('Requires:',
'').strip()
if dep == '':
- dep = "none"
+ dep = []
else:
dep.split(' ')
status.append({"group": "{}".format(lib_group), "name":
pip_pkg.split("==")[0], "version": version, "status": "installed", "add_pkgs":
dep})
else:
- if "Could not find a version that satisfies the requirement"
in err:
- versions = err[err.find("(from versions: ") + 16:
err.find(")\r\n")]
- if versions == '':
- versions = "none"
- else:
- versions = versions.split(' ')
- status.append({"group": "{}".format(lib_group), "name":
pip_pkg.split("==")[0], "status": "failed",
- "error_message": err, "available_versions":
versions})
+ versions = err[err.find("(from versions: ") + 16:
err.find(")\r\n")]
+ if versions == '':
+ versions = []
else:
- status.append({"group": "{}".format(lib_group), "name":
pip_pkg.split("==")[0], "status": "failed", "error_message": err})
+ versions = versions.split(', ')
+ status.append({"group": "{}".format(lib_group), "name":
pip_pkg.split("==")[0], "status": "failed",
+ "error_message": err, "available_versions":
versions})
return status
except Exception as err:
append_result("Failed to install {} packages".format(pip_version),
str(err))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]