ansible-doc more flexible to metadata changes

pull/21996/head
Brian Coca 8 years ago
parent 2804d2e848
commit ce08b4165d

@ -269,13 +269,13 @@ class DocCLI(CLI):
if 'deprecated' in doc and doc['deprecated'] is not None and len(doc['deprecated']) > 0: if 'deprecated' in doc and doc['deprecated'] is not None and len(doc['deprecated']) > 0:
text.append("DEPRECATED: \n%s\n" % doc['deprecated']) text.append("DEPRECATED: \n%s\n" % doc['deprecated'])
metadata = doc['metadata'] if doc['metadata'] and isinstance(doc['metadata'], dict):
text.append("Metadata:")
supported_by = metadata['supported_by'] for k in doc['metadata']:
text.append("Supported by: %s\n" % supported_by) if isinstance(k, list):
text.append("\t%s: %s\n" % (k.capitalize(), ", ".join(doc['metadata'][k])))
status = metadata['status'] else:
text.append("Status: %s\n" % ", ".join(status)) text.append("\t%s: %s\n" % (k.capitalize(), doc['metadata'][k]))
if 'action' in doc and doc['action']: if 'action' in doc and doc['action']:
text.append(" * note: %s\n" % "This module has a corresponding action plugin.") text.append(" * note: %s\n" % "This module has a corresponding action plugin.")

Loading…
Cancel
Save