From 1630d30be838fdb43d6f8646fd9cbd92dae74b89 Mon Sep 17 00:00:00 2001
From: ttimo <ttimo@ttimo.net>
Date: Thu, 28 Dec 2023 12:56:07 -0600
Subject: [PATCH] do not use a known_hosts file at all in the remote shell code
 paths. we were already not doing strict host key checking anyway, this
 reduces warning spam. plus cleanup unused/inadequate live_ssh_command.

---
 client/devkit_client/__init__.py | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/client/devkit_client/__init__.py b/client/devkit_client/__init__.py
index 3aac336..e29256e 100644
--- a/client/devkit_client/__init__.py
+++ b/client/devkit_client/__init__.py
@@ -615,12 +615,9 @@ class DevkitClient(object):
             # NOTE: this is the path to the ssh client, and may contain spaces (especially likely on windows)
             self.ssh
         ]
-        if self.ssh_known_hosts is not None:
-            cmd += [
-                '-o', f'UserKnownHostsFile={self.ssh_known_hosts}',
-            ]
         cmd += [
             '-o', 'StrictHostKeyChecking=no',
+            '-o', 'UserKnownHostsFile=/dev/null',
             '-o', 'IdentitiesOnly=yes',
             '-t',
             '-i', self.keypath,
@@ -628,20 +625,6 @@ class DevkitClient(object):
         ]
         return cmd
 
-    def live_ssh_command(self, username, ipaddress, command):
-        logger.debug('%s@%s: %s', username, ipaddress, command)
-        cmd = self.remote_shell_command(username, ipaddress)
-        cmd.append(command)
-        exit_status = subprocess.call(
-            cmd,
-            creationflags=SUBPROCESS_CREATION_FLAGS
-        )
-
-        logger.info("exit status is %d", exit_status)
-
-        if exit_status != 0:
-            raise subprocess.CalledProcessError(exit_status, command)
-
     def ssh_command(
             self, username, ipaddress, command, stdindata,
             stream_output_to=None
-- 
GitLab