mgr/cephadm: fix 'cephadm check-host'

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2020-02-05 17:39:39 -06:00
parent 744e2b28bf
commit 608eb783d8

View File

@ -994,11 +994,13 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin):
@orchestrator._cli_read_command(
'cephadm check-host',
'name=host,type=CephString',
'name=host,type=CephString '
'name=addr,type=CephString,req=false',
'Check whether we can access and manage a remote host')
def _check_host(self, host):
def _check_host(self, host, addr=None):
out, err, code = self._run_cephadm(host, 'client', 'check-host',
['--expect-hostname', host],
addr=addr,
error_ok=True, no_fsid=True)
if code:
return 1, '', ('check-host failed:\n' + '\n'.join(err))
@ -1009,7 +1011,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin):
if item.startswith('host %s ' % host):
self.log.debug('kicking serve thread')
self.event.set()
return 0, '%s ok' % host, err
return 0, '%s (%s) ok' % (host, addr), err
def _get_connection(self, host):
"""