From: Sage Weil Date: Wed, 5 Feb 2020 23:39:30 +0000 (-0600) Subject: mgr/cephadm: use addr to contact host X-Git-Tag: v15.1.1~506^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=744e2b28bf2031ecad5cb18272d0aa79b6cba2b2;p=ceph.git mgr/cephadm: use addr to contact host Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 21a38d33c37f..baa8da2d468f 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1049,6 +1049,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): return executable_path def _run_cephadm(self, host, entity, command, args, + addr=None, stdin=None, no_fsid=False, error_ok=False, @@ -1056,7 +1057,9 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): """ Run cephadm on the remote host with the given command + args """ - conn, connr = self._get_connection(host) + if not addr and host in self.inventory: + addr = self.inventory[host].get('addr', host) + conn, connr = self._get_connection(addr) try: if not image: @@ -1135,8 +1138,9 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): :param host: host name """ assert_valid_host(spec.hostname) - out, err, code = self._run_cephadm(spec.addr, 'client', 'check-host', + out, err, code = self._run_cephadm(spec.hostname, 'client', 'check-host', ['--expect-hostname', spec.hostname], + addr=spec.addr, error_ok=True, no_fsid=True) if code: raise OrchestratorError('New host %s (%s) failed check: %s' % (