You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by my...@apache.org on 2020/02/19 14:39:09 UTC

[incubator-dlab] 01/01: [DLAB-1527]: function for apt fixed and Unattended Upgrades disabled

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

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

commit bf0f249c5fd4221488be3a65457c6da2c701a870
Author: Mykola_Bodnar1 <bo...@gmail.com>
AuthorDate: Wed Feb 19 16:38:35 2020 +0200

    [DLAB-1527]: function for apt fixed and Unattended Upgrades disabled
---
 infrastructure-provisioning/src/general/lib/os/debian/common_lib.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 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 fe9d136..c4f8ff4 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -38,14 +38,14 @@ def manage_pkg(command, environment, requisites):
             else:
                 print('Package manager is:')
                 if environment == 'remote':
-                    if sudo('pgrep apt-get -a && echo "busy" || echo "ready"') == 'busy':
+                    if sudo('pgrep "^apt" -a && echo "busy" || echo "ready"') == 'busy':
                         counter += 1
                         time.sleep(10)
                     else:
                         allow = True
                         sudo('apt-get {0} {1}'.format(command, requisites))
                 elif environment == 'local':
-                    if local('sudo pgrep apt-get -a && echo "busy" || echo "ready"', capture=True) == 'busy':
+                    if local('sudo pgrep "^apt" -a && echo "busy" || echo "ready"', capture=True) == 'busy':
                         counter += 1
                         time.sleep(10)
                     else:
@@ -76,6 +76,8 @@ def ensure_pkg(user, requisites='linux-headers-generic python-pip python-dev '
                         manage_pkg('update', 'remote', '')
                         manage_pkg('-y install', 'remote', requisites)
                         sudo('unattended-upgrades -v')
+                        sudo(
+                            'sed -i \'s|APT::Periodic::Unattended-Upgrade "1"|APT::Periodic::Unattended-Upgrade "0"|\' /etc/apt/apt.conf.d/20auto-upgrades')
                         sudo('export LC_ALL=C')
                         sudo('touch /home/{}/.ensure_dir/pkg_upgraded'.format(user))
                         sudo('systemctl enable haveged')


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