]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
get_latest_image_version_deb(): run apt-get update 562/head
authorZack Cerza <zack@redhat.com>
Tue, 7 Jul 2015 22:42:05 +0000 (16:42 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 7 Jul 2015 23:26:58 +0000 (17:26 -0600)
When we were still using Chef, we accidentally ran it twice on downburst
VMs during scheduled jobs: once before the kernel task, and once after.
Now that we're using Ansible, and not running the one before, and
because the kernel task is special and runs before most tasks (even the
ansible task that might be part of the job), the kernel task might run
before apt has refreshed its cache. This is more likely to be a problem
on VMs, because their cache is certainly more stale, but could affect
physical hosts as well.

Make all deb-based systems update their cache before attempting to
install a kernel.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/kernel.py

index 62634a6c65267ad229f7b098fafc7cc5f86bc78e..bd4ba431f53882fd64b8ad98fdcc4ef5bdbdca50 100644 (file)
@@ -941,6 +941,7 @@ def get_latest_image_version_deb(remote, ostype):
     Round-about way to get the newest kernel uname -r compliant version string
     from the virtual package which is the newest kenel for debian/ubuntu.
     """
+    remote.run(args=['sudo', 'apt-get', 'update'])
     output = StringIO()
     newest = ''
     # Depend of virtual package has uname -r output in package name. Grab that.