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/02/22 09:38:41 UTC
[incubator-datalab] branch DATALAB-2091 updated: [DATALAB-2091]:
removed unnecessary prints, changed error_parced variable,
fixed while statement
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
The following commit(s) were added to refs/heads/DATALAB-2091 by this push:
new 0b0146b [DATALAB-2091]: removed unnecessary prints, changed error_parced variable, fixed while statement
0b0146b is described below
commit 0b0146bb52a6ee5238a1aabb2d45815c85d383d8
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Mon Feb 22 11:38:27 2021 +0200
[DATALAB-2091]: removed unnecessary prints, changed error_parced variable, fixed while statement
---
.../src/general/lib/os/debian/common_lib.py | 24 ++--------------------
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
index da8a8c0..cfb9b34 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -47,25 +47,13 @@ def manage_pkg(command, environment, requisites):
time.sleep(10)
else:
try:
- error_parser = "locked"
+ error_parser = "frontend is locked|locked"
print('=========0')
datalab.fab.conn.sudo('dpkg --configure -a 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E "({0})" /tmp/tee.tmp > '
'/tmp/dpkg.log; then echo "no_error" > /tmp/dpkg.log;fi'.format(error_parser))
- print('----------- install 1')
err = datalab.fab.conn.sudo('cat /tmp/dpkg.log').stdout
- print(str(err))
- print(err)
- print('----------- hostname')
- host = datalab.fab.conn.sudo('hostname').stdout
- print(str(host))
- print(host)
- print('=========cat /tmp/dpkg.log')
- datalab.fab.conn.sudo('cat /tmp/dpkg.log')
- print('=========xxd /tmp/dpkg.log')
- datalab.fab.conn.sudo('xxd /tmp/dpkg.log')
count = 0
while 'no_error' not in err and count < 10:
- print('error handling')
pid = datalab.fab.conn.sudo('lsof /var/lib/dpkg/lock-frontend | grep dpkg | awk \'{print $2}\'').stdout
if pid != '':
datalab.fab.conn.sudo('kill -9 {}'.format(pid))
@@ -78,22 +66,14 @@ def manage_pkg(command, environment, requisites):
'/tmp/dpkg.log; then echo "no_error" > /tmp/dpkg.log;fi'.format(error_parser))
err = datalab.fab.conn.sudo('cat /tmp/dpkg.log').stdout
count = count + 1
- print('----------- install 6')
datalab.fab.conn.sudo('apt update')
- print('----------- install 7')
datalab.fab.conn.sudo('apt-get {0} {1} 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E "({2})" /tmp/tee.tmp > '
'/tmp/apt.log; then echo "no_error" > /tmp/apt.log;fi'.format(command, requisites, error_parser))
print('----------- install 8')
datalab.fab.conn.sudo('ls -la /tmp/')
err = datalab.fab.conn.sudo('cat /tmp/apt.log').stdout
- print('=========cat /tmp/apt.log')
- datalab.fab.conn.sudo('cat /tmp/apt.log')
- print('=========xxd /tmp/apt.log')
- datalab.fab.conn.sudo('xxd /tmp/apt.log')
- print('=========')
- print('----------- install 9 err ' + err)
count = 0
- while err != '' and count < 10:
+ while 'no_error' not in err and count < 10:
datalab.fab.conn.sudo('lsof /var/lib/dpkg/lock')
datalab.fab.conn.sudo('lsof /var/lib/apt/lists/lock')
datalab.fab.conn.sudo('lsof /var/cache/apt/archives/lock')
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org