Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Attempts to re-establish connection. Returns True for success; False
for failure.
"""
- self.ssh.close()
+ if self.ssh is not None:
+ self.ssh.close()
try:
- self.ssh = self.connect()
+ self.connect()
return self.is_online
except Exception as e:
log.debug(e)
TODO refactor to move run.run here?
"""
+ if self.ssh is None:
+ self.reconnect()
r = self._runner(client=self.ssh, name=self.shortname, **kwargs)
r.remote = self
return r
raise NotImplementedError("sudo not supported")
self._sftp_put_file(path, dest_path)
- return
+ return
def get_file(self, path, sudo=False, dest_dir='/tmp'):
"""