Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
8b5b97d0
Commit
8b5b97d0
authored
Oct 30, 2014
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now docs handle deprecated modules but still ignore aliases
parent
27d74110
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
hacking/module_formatter.py
+10
-2
hacking/templates/rst.j2
+7
-0
No files found.
hacking/module_formatter.py
View file @
8b5b97d0
...
...
@@ -202,17 +202,23 @@ def process_module(module, options, env, template, outputname, module_map):
fname
=
module_map
[
module
]
basename
=
os
.
path
.
basename
(
fname
)
deprecated
=
False
# ignore files with extensions
if
not
os
.
path
.
basename
(
fname
)
.
endswith
(
".py"
):
if
not
basename
.
endswith
(
".py"
):
return
elif
basename
.
startswith
(
"_"
):
if
os
.
path
.
islink
(
fname
):
# alias
return
deprecated
=
True
# use ansible core library to parse out doc metadata YAML and plaintext examples
doc
,
examples
=
ansible
.
utils
.
module_docs
.
get_docstring
(
fname
,
verbose
=
options
.
verbose
)
# crash if module is missing documentation and not explicitly hidden from docs index
if
doc
is
None
and
module
not
in
ansible
.
utils
.
module_docs
.
BLACKLIST_MODULES
:
sys
.
stderr
.
write
(
"*** ERROR:
CORE
MODULE MISSING DOCUMENTATION:
%
s,
%
s ***
\n
"
%
(
fname
,
module
))
sys
.
stderr
.
write
(
"*** ERROR: MODULE MISSING DOCUMENTATION:
%
s,
%
s ***
\n
"
%
(
fname
,
module
))
sys
.
exit
(
1
)
if
doc
is
None
:
...
...
@@ -254,6 +260,8 @@ def process_module(module, options, env, template, outputname, module_map):
doc
[
'now_date'
]
=
datetime
.
date
.
today
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
doc
[
'ansible_version'
]
=
options
.
ansible_version
doc
[
'plainexamples'
]
=
examples
#plain text
if
deprecated
and
'deprecated'
not
in
doc
:
doc
[
'deprecated'
]
=
"This module is deprecated, as such it's use is discouraged."
# here is where we build the table of contents...
...
...
hacking/templates/rst.j2
View file @
8b5b97d0
...
...
@@ -21,6 +21,13 @@
#
--------------------------------------------#}
{% if deprecated is defined -%}
DEPRECATED
----------
@{ deprecated }@
{% endif %}
Synopsis
--------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment