Skip to content

Commit

Permalink
Fix "running" method in SSHVMProvider
Browse files Browse the repository at this point in the history
- Some of the arguments that being passed to "get_ssh_client"
  should be taken from the VM object and not from the provider.

- Check only one time if the VM is reachable via SSH.
  The purpose of the "running" method is to return the current
  status of the VM, not to wait until it's running.

Signed-off-by: gbenhaim <[email protected]>
  • Loading branch information
gbenhaim committed Jun 6, 2018
1 parent 6c17f75 commit a92fec3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lago/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def state(self, *args, **kwargs):
def running(self, *args, **kwargs):
try:
ssh.get_ssh_client(
ip_addr=self.ip(),
host_name=self.name(),
ip_addr=self.vm.ip(),
host_name=self.vm.name(),
propagate_fail=False,
ssh_key=self.virt_env.prefix.paths.ssh_id_rsa(),
username=self._spec.get('ssh-user'),
password=self._spec.get('ssh-password'),
ssh_tries=1,
ssh_key=self.vm.virt_env.prefix.paths.ssh_id_rsa(),
username=self.vm._spec.get('ssh-user'),
password=self.vm._spec.get('ssh-password'),
)
except ssh.LagoSSHTimeoutException:
return False
Expand Down

0 comments on commit a92fec3

Please sign in to comment.