Fixes: https://tracker.ceph.com/issues/51733
Signed-off-by: Adam King <adking@redhat.com>
ssh_options += ['-i', tkey.name]
self._temp_files = temp_files
- if ssh_options:
- self._ssh_options = ' '.join(ssh_options) # type: Optional[str]
- else:
- self._ssh_options = None
+ ssh_options += ['-o', 'ServerAliveInterval=7', '-o', 'ServerAliveCountMax=3']
+ self._ssh_options = ' '.join(ssh_options) # type: Optional[str]
if self.mode == 'root':
self.ssh_user = self.get_store('ssh_user', default='root')
if stdin:
self.log.debug('stdin: %s' % stdin)
- python = connr.choose_python()
+ try:
+ # if host has gone offline this is likely where we'll fail first
+ python = connr.choose_python()
+ except RuntimeError as e:
+ self.mgr.offline_hosts.add(host)
+ self.mgr._reset_con(host)
+ if error_ok:
+ return [], [str(e)], 1
+ raise
if not python:
raise RuntimeError(
'unable to find python on %s (tried %s in %s)' % (