]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use addr to contact host
authorSage Weil <sage@redhat.com>
Wed, 5 Feb 2020 23:39:30 +0000 (17:39 -0600)
committerSage Weil <sage@redhat.com>
Fri, 7 Feb 2020 19:36:45 +0000 (13:36 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py

index 21a38d33c37f35cd32df95f705081da79630d274..baa8da2d468f47cde4ebcff1edc95c520925ed23 100644 (file)
@@ -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' % (