From d42c5412da26f2058d3d70b6454cae60861c3b75 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Fri, 2 Aug 2024 19:32:33 +0200 Subject: [PATCH 1/3] provision/downburst: ignore "username@" prefix in hostname If downburst gets hostname as an argument which does not have a username@ prefix (does not include @-symbol) there is an index out of range error will occur, which we, obviously, don't want and wish to allow hostnames don't use login names. Signed-off-by: Kyr Shatskyy --- teuthology/provision/downburst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/provision/downburst.py b/teuthology/provision/downburst.py index 17b6818b07..41ea5a866d 100644 --- a/teuthology/provision/downburst.py +++ b/teuthology/provision/downburst.py @@ -215,7 +215,7 @@ def build_config(self): 'additional-disks-size': machine['volumes']['size'], 'arch': 'x86_64', } - fqdn = self.name.split('@')[1] + fqdn = self.name.split('@')[-1] file_out = { 'downburst': file_info, 'local-hostname': fqdn, From e3a44bb2fafd0e84b176e71c232dede374a92039 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Thu, 1 Aug 2024 12:01:10 +0200 Subject: [PATCH 2/3] provision/downburst: add PATH to environment Need to passthrough the PATH to downburst environment, otherwise on some system like macos where mkisofs installed via homebrew it cannot be found. Signed-off-by: Kyr Shatskyy --- teuthology/provision/downburst.py | 1 + 1 file changed, 1 insertion(+) diff --git a/teuthology/provision/downburst.py b/teuthology/provision/downburst.py index 41ea5a866d..97a511ef97 100644 --- a/teuthology/provision/downburst.py +++ b/teuthology/provision/downburst.py @@ -44,6 +44,7 @@ def downburst_executable(): def downburst_environment(): env = dict() + env['PATH'] = os.environ.get('PATH') discover_url = os.environ.get('DOWNBURST_DISCOVER_URL') if config.downburst and not discover_url: if isinstance(config.downburst, dict): From 837a0e188680456723805204ad87a8f4098203cd Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Wed, 31 Jul 2024 23:48:09 +0200 Subject: [PATCH 3/3] misc: allow _ssh_keyscan return None again A host may not have any keys, so _ssh_keyscan should return None, instead of failing with error: IndexError: list index out of range Fixes: dbd55e37563ce0fde01e1bfa19ca2fd2c03f0194 Signed-off-by: Kyr Shatskyy --- teuthology/misc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index c3d324a4bc..97521895ac 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -1127,7 +1127,8 @@ def _ssh_keyscan(hostname): for line in p.stdout: host, key = line.strip().decode().split(' ', 1) keys.append(key) - return sorted(keys)[0] + if len(keys) > 0: + return sorted(keys)[0] def ssh_keyscan_wait(hostname):