avocado_qemu: tweak ssh connect method
The current implementation will crash if the connection fails as the `time` module is not imported. Fix the import problem. While here, tweaks the connection to wait progressively when the connection fails. Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> [PMD: Reworded description] Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210920204932.94132-5-willianr@redhat.com>
This commit is contained in:
parent
e410bac070
commit
22e82e0982
@ -13,6 +13,7 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import avocado
|
import avocado
|
||||||
@ -305,8 +306,7 @@ class LinuxSSHMixIn:
|
|||||||
self.ssh_session.connect()
|
self.ssh_session.connect()
|
||||||
return
|
return
|
||||||
except:
|
except:
|
||||||
time.sleep(4)
|
time.sleep(i)
|
||||||
pass
|
|
||||||
self.fail('ssh connection timeout')
|
self.fail('ssh connection timeout')
|
||||||
|
|
||||||
def ssh_command(self, command):
|
def ssh_command(self, command):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user