]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph_key: if initial keys are missing, report which ones
authorDan Mick <dan.mick@redhat.com>
Tue, 18 Dec 2018 00:43:35 +0000 (16:43 -0800)
committerSébastien Han <seb@redhat.com>
Sat, 22 Dec 2018 14:32:02 +0000 (15:32 +0100)
Fixes: #3461
Signed-off-by: Dan Mick <dan.mick@redhat.com>
library/ceph_key.py

index bad741b383c1c67f19fb48f463317ad7c0dd6566..41287c93e98e7b00d8bfd7548b2591755846cbcf 100644 (file)
@@ -481,8 +481,13 @@ def lookup_ceph_initial_entities(module, out):
         fatal("'auth_dump' key not present in json output:", module)  # noqa E501
 
     if len(entities) != len(CEPH_INITIAL_KEYS):
-        return None
-
+        # must be missing in auth_dump, as if it were in CEPH_INITIAL_KEYS
+        # it'd be in entities from the above test. Report what's missing.
+        missing = []
+        for e in CEPH_INITIAL_KEYS:
+            if e not in entities:
+                missing.append(e)
+        fatal("initial keyring does not contain keys: " + ' '.join(missing), module)
     return entities
 
 
@@ -650,8 +655,6 @@ def run_module():
             module.exit_json(**result)
 
         entities = lookup_ceph_initial_entities(module, out)
-        if entities is None:
-            fatal("Failed to find some of the initial entities", module)
 
         output_format = "plain"
         for entity in entities: