This is an automated email from the ASF dual-hosted git repository. lfrolov pushed a commit to branch DLAB-1825 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 5d80f341927497e0210cea0b374179da75fbbd60 Author: leonidfrolov <[email protected]> AuthorDate: Tue Jun 9 10:23:45 2020 +0300 [DLAB-1825]: added possibility to enable warn_only for manage_pkg --- infrastructure-provisioning/src/general/lib/os/debian/common_lib.py | 4 ++-- infrastructure-provisioning/src/general/lib/os/fab.py | 2 +- 2 files changed, 3 insertions(+), 3 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 d7e129b..0c96260 100644 --- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py +++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py @@ -28,7 +28,7 @@ import os import time -def manage_pkg(command, environment, requisites): +def manage_pkg(command, environment, requisites, warn='False'): try: allow = False counter = 0 @@ -47,7 +47,7 @@ def manage_pkg(command, environment, requisites): sudo('sudo dpkg --configure -a') sudo('sudo apt update') try: - sudo('apt-get {0} {1}'.format(command, requisites)) + sudo('apt-get {0} {1}'.format(command, requisites), warn_only=warn) except: sudo('lsof /var/lib/dpkg/lock') sudo('lsof /var/lib/apt/lists/lock') diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py index 54cfe1c..33d68a7 100644 --- a/infrastructure-provisioning/src/general/lib/os/fab.py +++ b/infrastructure-provisioning/src/general/lib/os/fab.py @@ -212,7 +212,7 @@ def configure_docker(os_user): stable"') manage_pkg('update', 'remote', '') sudo('apt-cache policy docker-ce') - manage_pkg('-y install', 'remote', 'docker-ce={}~ce~3-0~ubuntu'.format(docker_version)) + manage_pkg('-y install', 'remote', 'docker-ce={}~ce~3-0~ubuntu'.format(docker_version), 'True') sudo('touch /home/{}/.ensure_dir/docker_ensured'.format(os_user)) except Exception as err: print('Failed to configure Docker:', str(err)) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
