From 10d7f9095fbb42747f832aea129a9cc73d9ebe24 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 4 Dec 2014 09:49:56 +0300 Subject: [PATCH] kernel: fix commit hash matching in need_to_install() We don't need to install a new kernel if the "want" (version) commit hash and the "have" (cur_sha1) commit hash match but the former is shorter than the latter. Signed-off-by: Ilya Dryomov --- teuthology/task/kernel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index e67fe35e50..c28412974b 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -166,7 +166,7 @@ def need_to_install(ctx, role, version): cur_sha1 = cur_sha1[0:dloc] log.debug('extracting sha1, {ver} -> {sha1}'.format( ver=cur_version, sha1=cur_sha1)) - if version.startswith(cur_sha1): + if cur_sha1.startswith(version): log.debug('extracted sha1 matches, do not need to install') ret = False else: -- 2.39.5