]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: make `orch status` fail, if ssh key is not set
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 19 Jun 2020 15:50:04 +0000 (17:50 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 19 Jun 2020 15:50:04 +0000 (17:50 +0200)
ceph-salt relies on the output of `orch status` to determine the
end of the bootstrap process.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/cephadm/module.py

index 8bdfe2bdbbcc28399c30d25d59e8031239b65379..4b247907ac83ceb1cc8073b555681509ad8b6312 100644 (file)
@@ -674,7 +674,12 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
         """
         The cephadm orchestrator is always available.
         """
-        return self.can_run()
+        ok, err = self.can_run()
+        if not ok:
+            return ok, err
+        if not self.ssh_key or not self.ssh_pub:
+            return False, 'SSH keys not set. Use `ceph cephadm set-priv-key` and `ceph cephadm set-pub-key` or `ceph cephadm generate-key`'
+        return True, ''
 
     def process(self, completions):
         """