diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-06 19:44:35 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-11 18:07:24 +0200 |
commit | 3f10742b14e50e02b1f9d87c14fa20de1132ba61 (patch) | |
tree | c54c89afc3bf0feca68ef637e05b4bd6ba942f7a | |
parent | fea5f1e990a79018a865a2d171d8992370e49b61 (diff) |
Fix delete_keypair arg
It uses keypair name instead of id as expected by Shade.
It also increases timers as it boots an ubuntu VM.
Change-Id: I8cd131e7c7a94c8f6b0fcc54a4d75ef8af31b807
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit e2e68a3806dc89fdc35cc7925b2c6c4118d5569d)
-rw-r--r-- | functest/core/singlevm.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index c3fb3d603..23f453722 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -242,6 +242,7 @@ class SingleVm1(VmReady1): __logger = logging.getLogger(__name__) username = 'cirros' ssh_connect_timeout = 60 + ssh_connect_loops = 6 def __init__(self, **kwargs): if "case_name" not in kwargs: @@ -296,7 +297,7 @@ class SingleVm1(VmReady1): self.__logger.debug("vm console: \n%s", p_console) ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.client.AutoAddPolicy()) - for loop in range(6): + for loop in range(self.ssh_connect_loops): try: ssh.connect( fip.floating_ip_address, @@ -370,7 +371,7 @@ class SingleVm1(VmReady1): self.cloud.delete_floating_ip(self.fip.id) self.cloud.delete_server(self.sshvm, wait=True) self.cloud.delete_security_group(self.sec.id) - self.cloud.delete_keypair(self.keypair.id) + self.cloud.delete_keypair(self.keypair.name) super(SingleVm1, self).clean() except Exception: # pylint: disable=broad-except self.__logger.exception("Cannot clean all ressources") |