1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

ansible-doc more flexible to metadata changes

This commit is contained in:
Brian Coca 2017-02-24 20:58:19 -05:00
parent 2804d2e848
commit ce08b4165d

View file

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