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/17 12:56:02 UTC

[incubator-datalab] 03/03: [DATALAB-2091]: added some prints for testing

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 0c6022c83dd161febd17a6317dcc1f39a20c2990
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Feb 17 14:55:44 2021 +0200

    [DATALAB-2091]: added some prints for testing
---
 .../src/general/lib/os/debian/common_lib.py                      | 9 +++++++++
 1 file changed, 9 insertions(+)

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 123d024..8b87970 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -43,33 +43,40 @@ def manage_pkg(command, environment, requisites):
                 print('Package manager is:')
                 if environment == 'remote':
                     if conn.sudo('pgrep "^apt" -a && echo "busy" || echo "ready"') == 'busy' or conn.sudo('pgrep "^dpkg" -a && echo "busy" || echo "ready"') == 'busy':
+                        print('----------- manager not ready')
                         counter += 1
                         time.sleep(10)
                     else:
                         try:
+                            print('----------- install 1')
                             error_parser = "frontend is locked|locked"
                             conn.sudo('dpkg --configure -a 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E "({0})" /tmp/tee.tmp > '
                                      '/tmp/dpkg.log; then echo "" > /tmp/dpkg.log;fi'.format(error_parser))
                             err = conn.sudo('cat /tmp/dpkg.log')
+                            print('----------- install 2 err ' + err)
                             count = 0
                             while err != '' and count < 10:
                                 pid = conn.sudo('lsof /var/lib/dpkg/lock-frontend | grep dpkg | awk \'{print $2}\'')
+                                print('----------- install 3 pid ' + pid)
                                 if pid != '':
                                     conn.sudo('kill -9 {}'.format(pid))
                                     conn.sudo('rm -f /var/lib/dpkg/lock-frontend')
                                     pid = conn.sudo('lsof /var/lib/dpkg/lock | grep dpkg | awk \'{print $2}\'')
+                                    print('----------- install 4 pid ' + pid)
                                 elif pid != '':
                                     conn.sudo('kill -9 {}'.format(pid))
                                     conn.sudo('rm -f /var/lib/dpkg/lock')
                                 conn.sudo('dpkg --configure -a 2>&1 | tee /tmp/tee.tmp; if ! grep -w -E "({0})" /tmp/tee.tmp > '
                                      '/tmp/dpkg.log; then echo "" > /tmp/dpkg.log;fi'.format(error_parser))
                                 err = conn.sudo('cat /tmp/dpkg.log')
+                                print('----------- install 5 err ' + err)
                                 count = count + 1
                             conn.sudo('apt update')
 
                             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 "" > /tmp/apt.log;fi'.format(command, requisites, error_parser))
                             err = conn.sudo('cat /tmp/apt.log')
+                            print('----------- install 6 err ' + err)
                             count = 0
                             while err != '' and count < 10:
                                 conn.sudo('lsof /var/lib/dpkg/lock')
@@ -115,7 +122,9 @@ def ensure_pkg(user, requisites='linux-headers-generic python3-pip python3-dev p
                         print("Updating repositories "
                                 "and installing requested tools: {}".format(requisites))
                         print("Attempt number " + str(count) + " to install requested tools. Max 60 tries.")
+                        print("------- manage_pkg 1")
                         manage_pkg('update', 'remote', '')
+                        print("------- manage_pkg 2")
                         manage_pkg('-y install', 'remote', requisites)
                         conn.sudo('unattended-upgrades -v')
                         conn.sudo(


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