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
01a6081b
Commit
01a6081b
authored
Feb 10, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First swing at making module_common.py more v2-ish
parent
0e834509
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
10 deletions
+9
-10
v2/ansible/executor/module_common.py
+0
-0
v2/ansible/module_utils/basic.py
+1
-1
v2/ansible/modules/core
+1
-1
v2/ansible/plugins/action/__init__.py
+3
-3
v2/hacking/test-module
+4
-5
No files found.
v2/ansible/executor/module_common.py
View file @
01a6081b
This diff is collapsed.
Click to expand it.
v2/ansible/module_utils/basic.py
View file @
01a6081b
...
...
@@ -43,7 +43,7 @@ BOOLEANS = BOOLEANS_TRUE + BOOLEANS_FALSE
# can be inserted in any module source automatically by including
# #<<INCLUDE_ANSIBLE_MODULE_COMMON>> on a blank line by itself inside
# of an ansible module. The source of this common code lives
# in
lib/ansible
/module_common.py
# in
ansible/executor
/module_common.py
import
locale
import
os
...
...
core
@
095f8681
Subproject commit
34784b7a617aa35d3b994c9f0795567afc6fb0b0
Subproject commit
095f8681dbdfd2e9247446822e953287c9bca66c
v2/ansible/plugins/action/__init__.py
View file @
01a6081b
...
...
@@ -29,7 +29,7 @@ import time
from
ansible
import
constants
as
C
from
ansible.errors
import
AnsibleError
from
ansible.executor.module_common
import
ModuleReplacer
from
ansible.executor.module_common
import
modify_module
from
ansible.parsing.utils.jsonify
import
jsonify
from
ansible.plugins
import
shell_loader
...
...
@@ -78,7 +78,7 @@ class ActionBase:
def
_configure_module
(
self
,
module_name
,
module_args
):
'''
Handles the loading and templating of the module code through the
ModuleReplacer class
.
modify_module() function
.
'''
# Search module path(s) for named module.
...
...
@@ -94,7 +94,7 @@ class ActionBase:
"run 'git submodule update --init --recursive' to correct this problem."
%
(
module_name
))
# insert shared code and arguments into the module
(
module_data
,
module_style
,
module_shebang
)
=
ModuleReplacer
()
.
modify_module
(
module_path
,
module_args
)
(
module_data
,
module_style
,
module_shebang
)
=
modify_module
(
module_path
,
module_args
)
return
(
module_style
,
module_shebang
,
module_data
)
...
...
v2/hacking/test-module
View file @
01a6081b
...
...
@@ -34,8 +34,9 @@ import os
import
subprocess
import
traceback
import
optparse
import
ansible.utils
as
utils
import
ansible.module_common
as
module_common
from
ansible
import
utils
from
ansible
import
module_common
import
ansible.constants
as
C
try
:
...
...
@@ -87,8 +88,6 @@ def boilerplate_module(modfile, args, interpreter, check):
#module_data = module_fh.read()
#module_fh.close()
replacer
=
module_common
.
ModuleReplacer
()
#included_boilerplate = module_data.find(module_common.REPLACER) != -1 or module_data.find("import ansible.module_utils") != -1
complex_args
=
{}
...
...
@@ -116,7 +115,7 @@ def boilerplate_module(modfile, args, interpreter, check):
if
check
:
complex_args
[
'CHECKMODE'
]
=
True
(
module_data
,
module_style
,
shebang
)
=
replacer
.
modify_module
(
(
module_data
,
module_style
,
shebang
)
=
module_common
.
modify_module
(
modfile
,
complex_args
,
args
,
...
...
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