From d25888f410cba4a2f4320dd98d4a5749ac1790c0 Mon Sep 17 00:00:00 2001 From: Stoned Elipot Date: Thu, 16 May 2013 17:13:18 +0200 Subject: [PATCH] Fix empty requirements specifications in modules documentation And also be liberal in what ansible-doc accepts as an empty requirements specification. While here fix a typo in template module documentation wrt jinja2 overrides example. --- bin/ansible-doc | 2 +- library/files/template | 4 ++-- library/utilities/wait_for | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ansible-doc b/bin/ansible-doc index 5392ecdd51b..c6dfc8f6bc9 100755 --- a/bin/ansible-doc +++ b/bin/ansible-doc @@ -86,7 +86,7 @@ def print_man(doc): subsequent_indent=opt_indent) - if 'requirements' in doc and len(doc['requirements']) > 0: + if 'requirements' in doc and doc['requirements'] is not None and len(doc['requirements']) > 0: req = ", ".join(doc['requirements']) print "Requirements:%s\n" % textwrap.fill(tty_ify(req), initial_indent=" ", subsequent_indent=opt_indent) diff --git a/library/files/template b/library/files/template index 5ed76d0abe4..b7133dc2c78 100644 --- a/library/files/template +++ b/library/files/template @@ -53,7 +53,7 @@ examples: notes: - Since Ansible version 0.9, templates are loaded with C(trim_blocks=True). - 'You can override jinja2 settings by adding a special header to template file. - i.e. c(#jinja2: trim_blocks: False)' -requirements: null + i.e. C(#jinja2: trim_blocks: False)' +requirements: [] author: Michael DeHaan ''' diff --git a/library/utilities/wait_for b/library/utilities/wait_for index b41b2a3ae2b..00ee901d3a9 100644 --- a/library/utilities/wait_for +++ b/library/utilities/wait_for @@ -64,7 +64,7 @@ examples: - code: "wait_for: port=8000 delay=10" description: "Example from Ansible Playbooks" notes: [] -requirements: null +requirements: [] author: Jeroen Hoekx '''