From dbd55e37563ce0fde01e1bfa19ca2fd2c03f0194 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 5 Sep 2023 12:42:46 -0600 Subject: [PATCH] misc._ssh_keyscan: Sort keys before returning any ssh-keyscan's output is unsorted, so this function wasn't deterministic. Signed-off-by: Zack Cerza --- teuthology/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 76a21815d..c03be7e85 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -1138,9 +1138,11 @@ def _ssh_keyscan(hostname): line = line.strip() if line and not line.startswith('#'): log.error(line) + keys = list() for line in p.stdout: host, key = line.strip().decode().split(' ', 1) - return key + keys.append(key) + return sorted(keys)[0] def ssh_keyscan_wait(hostname):