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
30101905
Commit
30101905
authored
May 23, 2015
by
Florian Apolloner
Committed by
James Cammarata
May 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing up the hacking module_formatter code for v2
parent
838ff320
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
hacking/module_formatter.py
+8
-7
No files found.
hacking/module_formatter.py
View file @
30101905
...
@@ -33,8 +33,8 @@ import subprocess
...
@@ -33,8 +33,8 @@ import subprocess
import
cgi
import
cgi
from
jinja2
import
Environment
,
FileSystemLoader
from
jinja2
import
Environment
,
FileSystemLoader
import
ansible.util
s
from
ansible.utils
import
module_doc
s
import
ansible.utils.module_docs
as
module_docs
from
ansible.utils.vars
import
merge_hash
#####################################################################################
#####################################################################################
# constants and paths
# constants and paths
...
@@ -135,7 +135,7 @@ def list_modules(module_dir, depth=0):
...
@@ -135,7 +135,7 @@ def list_modules(module_dir, depth=0):
res
=
list_modules
(
d
,
depth
+
1
)
res
=
list_modules
(
d
,
depth
+
1
)
for
key
in
res
.
keys
():
for
key
in
res
.
keys
():
if
key
in
categories
:
if
key
in
categories
:
categories
[
key
]
=
ansible
.
utils
.
merge_hash
(
categories
[
key
],
res
[
key
])
categories
[
key
]
=
merge_hash
(
categories
[
key
],
res
[
key
])
res
.
pop
(
key
,
None
)
res
.
pop
(
key
,
None
)
if
depth
<
2
:
if
depth
<
2
:
...
@@ -236,11 +236,11 @@ def process_module(module, options, env, template, outputname, module_map, alias
...
@@ -236,11 +236,11 @@ def process_module(module, options, env, template, outputname, module_map, alias
print
"rendering:
%
s"
%
module
print
"rendering:
%
s"
%
module
# use ansible core library to parse out doc metadata YAML and plaintext examples
# use ansible core library to parse out doc metadata YAML and plaintext examples
doc
,
examples
,
returndocs
=
ansible
.
utils
.
module_docs
.
get_docstring
(
fname
,
verbose
=
options
.
verbose
)
doc
,
examples
,
returndocs
=
module_docs
.
get_docstring
(
fname
,
verbose
=
options
.
verbose
)
# crash if module is missing documentation and not explicitly hidden from docs index
# crash if module is missing documentation and not explicitly hidden from docs index
if
doc
is
None
:
if
doc
is
None
:
if
module
in
ansible
.
utils
.
module_docs
.
BLACKLIST_MODULES
:
if
module
in
module_docs
.
BLACKLIST_MODULES
:
return
"SKIPPED"
return
"SKIPPED"
else
:
else
:
sys
.
stderr
.
write
(
"*** ERROR: MODULE MISSING DOCUMENTATION:
%
s,
%
s ***
\n
"
%
(
fname
,
module
))
sys
.
stderr
.
write
(
"*** ERROR: MODULE MISSING DOCUMENTATION:
%
s,
%
s ***
\n
"
%
(
fname
,
module
))
...
@@ -278,8 +278,9 @@ def process_module(module, options, env, template, outputname, module_map, alias
...
@@ -278,8 +278,9 @@ def process_module(module, options, env, template, outputname, module_map, alias
if
added
and
added_float
<
TO_OLD_TO_BE_NOTABLE
:
if
added
and
added_float
<
TO_OLD_TO_BE_NOTABLE
:
del
doc
[
'version_added'
]
del
doc
[
'version_added'
]
for
(
k
,
v
)
in
doc
[
'options'
]
.
iteritems
():
if
'options'
in
doc
:
all_keys
.
append
(
k
)
for
(
k
,
v
)
in
doc
[
'options'
]
.
iteritems
():
all_keys
.
append
(
k
)
all_keys
=
sorted
(
all_keys
)
all_keys
=
sorted
(
all_keys
)
...
...
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