From edac7f326c8138d7377d595a3cf26f7f3d36b0fb Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 8 Nov 2020 09:31:10 +0200 Subject: fix(subplot/qemumgr.py): use known hosts file to avoid warning "Host key added" warning was always happening in the ssh output, and it's annoying. This avoids it. --- subplot/qemumgr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'subplot') diff --git a/subplot/qemumgr.py b/subplot/qemumgr.py index 0550bdb..bfc3f24 100755 --- a/subplot/qemumgr.py +++ b/subplot/qemumgr.py @@ -8,8 +8,7 @@ import shlex import shutil import signal import subprocess - -# import tempfile +import tempfile import time @@ -37,6 +36,9 @@ class QemuSystem: self._port = None self._pid = None + fd, self._knownhosts = tempfile.mkstemp() + os.close(fd) + def _join(self, *names): return os.path.join(self._dirname, *names) @@ -169,7 +171,7 @@ class QemuSystem: str(self._port), "-l", self._username, - "-ouserknownhostsfile=/dev/null", + f"-ouserknownhostsfile={self._knownhosts}", "-ostricthostkeychecking=accept-new", "-opasswordauthentication=no", ] -- cgit v1.2.1