[dts] [PATCH V1] framework/qemu_libvirt: rm ssh keygen before connect to vm

lihong lihongx.ma at intel.com
Wed Sep 25 01:48:50 CEST 2019


Signed-off-by: lihong <lihongx.ma at intel.com>
---
 framework/qemu_libvirt.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/framework/qemu_libvirt.py b/framework/qemu_libvirt.py
index d2edd31..5b25dec 100644
--- a/framework/qemu_libvirt.py
+++ b/framework/qemu_libvirt.py
@@ -817,6 +817,9 @@ class LibvirtKvm(VirtBase):
         while count:
             out = self.__control_session('ifconfig')
             if "10.0.2" in out:
+                pos = self.vm_ip.find(':')
+                ssh_key = '[' + self.vm_ip[:pos] + ']' + self.vm_ip[pos:]
+                os.system('ssh-keygen -R %s' % ssh_key)
                 return True
             time.sleep(6)
             count -= 1
-- 
2.7.4



More information about the dts mailing list