aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-01-09 17:49:06 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-01-12 14:57:25 +0100
commitd8ee9eae0f08b9408a143cea71f0114457660c30 (patch)
tree38b4400ee8e3c5386617fb38a795eb0431266181
parent658a41da85783d0ea06b91e5c72f755144b2e449 (diff)
downloadrumba-d8ee9eae0f08b9408a143cea71f0114457660c30.tar.gz
rumba-d8ee9eae0f08b9408a143cea71f0114457660c30.zip
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.
-rw-r--r--rumba/ssh_support.py10
1 files 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)