From 7a1439a368d2828bdea5e1817aa4d4c72686cbdf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 4 Feb 2020 07:23:13 -0600 Subject: [PATCH] mgr/cephadm: verify host's hostname matches our host name This ensures that we have a consistent view between the hosts that cephadm is using and the hostname being reported as metadata by the ceph daemons. Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 68a62bc47ac..53e759a4dbd 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -985,7 +985,8 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): 'name=host,type=CephString', 'Check whether we can access and manage a remote host') def _check_host(self, host): - out, err, code = self._run_cephadm(host, 'client', 'check-host', [], + out, err, code = self._run_cephadm(host, 'client', 'check-host', + ['--expect-hostname', host], error_ok=True, no_fsid=True) if code: return 1, '', ('check-host failed:\n' + '\n'.join(err)) @@ -1120,7 +1121,8 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): :param host: host name """ - out, err, code = self._run_cephadm(host, 'client', 'check-host', [], + out, err, code = self._run_cephadm(host, 'client', 'check-host', + ['--expect-hostname', host], error_ok=True, no_fsid=True) if code: raise OrchestratorError('New host %s failed check: %s' % (host, err)) -- 2.39.5