Skip to content

Commit

Permalink
ansible-doc more flexible to metadata changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoca committed Feb 25, 2017
1 parent 2804d2e commit ce08b41
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/ansible/cli/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ def get_man_text(self, doc):
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.")
Expand Down

0 comments on commit ce08b41

Please sign in to comment.