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
36066d86
Commit
36066d86
authored
Jan 26, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup ec2_facts docs parsing
parent
5e4d2956
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
bin/ansible-doc
+6
-3
lib/ansible/utils/module_docs.py
+0
-1
library/ec2_facts
+5
-8
No files found.
bin/ansible-doc
View file @
36066d86
...
@@ -33,6 +33,7 @@ from ansible import errors
...
@@ -33,6 +33,7 @@ from ansible import errors
from
ansible.utils
import
module_docs
from
ansible.utils
import
module_docs
import
ansible.constants
as
C
import
ansible.constants
as
C
from
ansible.utils
import
version
from
ansible.utils
import
version
import
traceback
MODULEDIR
=
C
.
DEFAULT_MODULE_PATH
MODULEDIR
=
C
.
DEFAULT_MODULE_PATH
...
@@ -162,7 +163,8 @@ def main():
...
@@ -162,7 +163,8 @@ def main():
desc
=
desc
+
'...'
desc
=
desc
+
'...'
print
"
%-20
s
%-60.60
s"
%
(
module
,
desc
)
print
"
%-20
s
%-60.60
s"
%
(
module
,
desc
)
except
:
except
:
sys
.
stderr
.
write
(
"ERROR: module
%
s missing documentation
\n
"
%
module
)
traceback
.
print_exc
()
sys
.
stderr
.
write
(
"ERROR: module
%
s has a documentation error formatting or is missing documentation
\n
"
%
module
)
pass
pass
sys
.
exit
()
sys
.
exit
()
...
@@ -184,10 +186,11 @@ def main():
...
@@ -184,10 +186,11 @@ def main():
try
:
try
:
doc
=
module_docs
.
get_docstring
(
filename
)
doc
=
module_docs
.
get_docstring
(
filename
)
except
:
except
:
sys
.
stderr
.
write
(
"ERROR: module
%
s missing documentation
\n
"
%
module
)
traceback
.
print_exc
()
sys
.
stderr
.
write
(
"ERROR: module
%
s has a documentation error formatting or is missing documentation
\n
"
%
module
)
continue
continue
if
not
doc
is
None
:
if
doc
is
not
None
:
all_keys
=
[]
all_keys
=
[]
for
(
k
,
v
)
in
doc
[
'options'
]
.
iteritems
():
for
(
k
,
v
)
in
doc
[
'options'
]
.
iteritems
():
...
...
lib/ansible/utils/module_docs.py
View file @
36066d86
...
@@ -43,7 +43,6 @@ def get_docstring(filename, verbose=False):
...
@@ -43,7 +43,6 @@ def get_docstring(filename, verbose=False):
if
isinstance
(
child
,
ast
.
Assign
):
if
isinstance
(
child
,
ast
.
Assign
):
if
'DOCUMENTATION'
in
(
t
.
id
for
t
in
child
.
targets
):
if
'DOCUMENTATION'
in
(
t
.
id
for
t
in
child
.
targets
):
doc
=
yaml
.
load
(
child
.
value
.
s
)
doc
=
yaml
.
load
(
child
.
value
.
s
)
except
:
except
:
if
verbose
==
True
:
if
verbose
==
True
:
traceback
.
print_exc
()
traceback
.
print_exc
()
...
...
library/ec2_facts
View file @
36066d86
...
@@ -16,8 +16,7 @@
...
@@ -16,8 +16,7 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
DOCUMENTATION
=
"""
DOCUMENTATION
=
'''
---
---
module: ec2_facts
module: ec2_facts
short_description: Gathers facts about remote hosts within ec2 (aws)
short_description: Gathers facts about remote hosts within ec2 (aws)
...
@@ -29,12 +28,10 @@ description:
...
@@ -29,12 +28,10 @@ description:
notes:
notes:
- Parameters to filter on ec2_facts may be added later.
- Parameters to filter on ec2_facts may be added later.
examples:
examples:
- code: ansible all -m ec2_facts --tree /tmp/facts
- code: ansible all -m ec2_facts
description: Obtain facts from ec2 metatdata servers. You will need to
description: Obtain facts from ec2 metatdata servers. You will need to run an instance within ec2.
run an instance within ec2.
author: "Silviu Dicu <silviudicu@gmail.com>"
"""
author: Silviu Dicu: silviudicu@gmail.com
'''
import
urllib2
import
urllib2
import
socket
import
socket
...
...
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