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
bceb0026
Commit
bceb0026
authored
Sep 26, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating the module formatter to deal with the new repo structure.
parent
e5116d2f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
Makefile
+2
-2
docsite/Makefile
+1
-1
hacking/module_formatter.py
+11
-6
lib/ansible/modules/core
+1
-1
No files found.
Makefile
View file @
bceb0026
...
...
@@ -91,7 +91,7 @@ NOSETESTS ?= nosetests
all
:
clean python
tests
:
PYTHONPATH
=
./lib
ANSIBLE_LIBRARY
=
./lib
rary
$(NOSETESTS)
-d
-w
test
/units
-v
PYTHONPATH
=
./lib
ANSIBLE_LIBRARY
=
./lib
/ansible/modules
$(NOSETESTS)
-d
-w
test
/units
-v
authors
:
sh hacking/authors.sh
...
...
@@ -114,7 +114,7 @@ pep8:
@
echo
"# Running PEP8 Compliance Tests"
@
echo
"#############################################"
-
pep8
-r
--ignore
=
E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 lib/ bin/
-
pep8
-r
--ignore
=
E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241
--filename
"*"
library/
#
-pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 --filename "*" library/
pyflakes
:
pyflakes lib/ansible/
*
.py lib/ansible/
*
/
*
.py bin/
*
...
...
docsite/Makefile
View file @
bceb0026
...
...
@@ -40,7 +40,7 @@ clean:
.PHONEY
:
docs clean
modules
:
$(FORMATTER) ../hacking/templates/rst.j2
PYTHONPATH
=
../lib
$(FORMATTER)
-t
rst
--template-dir
=
../hacking/templates
--module-dir
=
../lib
rary
-o
rst/
PYTHONPATH
=
../lib
$(FORMATTER)
-t
rst
--template-dir
=
../hacking/templates
--module-dir
=
../lib
/ansible/modules
-o
rst/
staticmin
:
cat
_themes/srtd/static/css/theme.css | sed
-e
's/^[ \t]*//g; s/[ \t]*$$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$$/d'
| sed
-e
:a
-e
'$$!N; s/\n\(.\)/\1/; ta'
>
_themes/srtd/static/css/theme.min.css
hacking/module_formatter.py
View file @
bceb0026
#!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
# (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others
#
# This file is part of Ansible
#
...
...
@@ -44,7 +45,7 @@ TO_OLD_TO_BE_NOTABLE = 1.0
# Get parent directory of the directory this script lives in
MODULEDIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
os
.
pardir
,
'lib
rary
'
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
os
.
pardir
,
'lib
'
,
'ansible'
,
'modules
'
))
# The name of the DOCUMENTATION template
...
...
@@ -106,7 +107,9 @@ def write_data(text, options, outputname, module):
''' dumps module output to a file or the screen, as requested '''
if
options
.
output_dir
is
not
None
:
f
=
open
(
os
.
path
.
join
(
options
.
output_dir
,
outputname
%
module
),
'w'
)
fname
=
os
.
path
.
join
(
options
.
output_dir
,
outputname
%
module
)
fname
=
fname
.
replace
(
".py"
,
""
)
f
=
open
(
fname
,
'w'
)
f
.
write
(
text
.
encode
(
'utf-8'
))
f
.
close
()
else
:
...
...
@@ -114,23 +117,24 @@ def write_data(text, options, outputname, module):
#####################################################################################
def
list_modules
(
module_dir
):
''' returns a hash of categories, each category being a hash of module names to file paths '''
categories
=
dict
(
all
=
dict
())
files
=
glob
.
glob
(
"
%
s/*"
%
module_dir
)
files
=
glob
.
glob
(
"
%
s/*
/*
"
%
module_dir
)
for
d
in
files
:
if
os
.
path
.
isdir
(
d
):
files2
=
glob
.
glob
(
"
%
s/*"
%
d
)
for
f
in
files2
:
if
f
.
endswith
(
".ps1"
):
if
not
f
.
endswith
(
".py"
)
or
f
.
endswith
(
'__init__.py'
):
# windows powershell modules have documentation stubs in python docstring
# format (they are not executed) so skip the ps1 format files
continue
tokens
=
f
.
split
(
"/"
)
module
=
tokens
[
-
1
]
module
=
tokens
[
-
1
]
.
replace
(
".py"
,
""
)
category
=
tokens
[
-
2
]
if
not
category
in
categories
:
categories
[
category
]
=
{}
...
...
@@ -191,7 +195,7 @@ def process_module(module, options, env, template, outputname, module_map):
fname
=
module_map
[
module
]
# ignore files with extensions
if
"."
in
os
.
path
.
basename
(
fname
):
if
not
os
.
path
.
basename
(
fname
)
.
endswith
(
".py"
):
return
# use ansible core library to parse out doc metadata YAML and plaintext examples
...
...
@@ -201,6 +205,7 @@ def process_module(module, options, env, template, outputname, module_map):
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
.
exit
(
1
)
if
doc
is
None
:
return
"SKIPPED"
...
...
core
@
617a52b2
Subproject commit
385a037cd6bc42fc64e387973c0e7ef539b04df7
Subproject commit
617a52b20d512a4eb5e88fdc76658b220ff80266
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