From d8ee9eae0f08b9408a143cea71f0114457660c30 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 9 Jan 2018 17:49:06 +0100 Subject: ssh_support: Fix aptitude update bug in exogeni This fixes a bug for when the default image is Ubuntu, which updates the packages upon swap-in, since the update deadline has been met. This commit waits for it to finish and then updates and installs the packages until it works. --- rumba/ssh_support.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py index 1ffa655..69c049c 100644 --- a/rumba/ssh_support.py +++ b/rumba/ssh_support.py @@ -406,13 +406,9 @@ def aptitude_install(testbed, node, packages): package_install += package + " " package_install += "--yes" - cmds = [sudo("systemctl disable apt-daily.service || true"), - sudo("systemctl disable apt-daily.timer || true"), - sudo("systemctl stop apt-daily.service || true"), - sudo("systemctl stop apt-daily.timer || true"), - sudo("sh -c 'while fuser /var/lib/dpkg/lock > /dev/null 2>&1; " + + cmds = [sudo("sh -c 'while fuser /var/lib/dpkg/lock > /dev/null 2>&1; " + "do sleep 1; echo \"Waiting for dpkg...\"; done'"), - sudo("apt-get update"), - sudo(package_install)] + "while ! " + sudo("apt-get update") + "; do sleep 1; done", + "while ! " + sudo(package_install) + "; do sleep 1; done"] execute_proxy_commands(testbed, node.ssh_config, cmds, time_out=None) -- cgit v1.2.3