]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: verify host's hostname matches our host name
authorSage Weil <sage@redhat.com>
Tue, 4 Feb 2020 13:23:13 +0000 (07:23 -0600)
committerSage Weil <sage@redhat.com>
Tue, 4 Feb 2020 16:30:53 +0000 (10:30 -0600)
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 <sage@redhat.com>
src/pybind/mgr/cephadm/module.py

index 68a62bc47ac10d6fc566c3b8163692860d51f272..53e759a4dbdf45f8613708cd9aaf451104b56deb 100644 (file)
@@ -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))