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
53ae3266
Commit
53ae3266
authored
Jul 31, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port some things in test-module to v2.
In particular, fix arg parsing Fixes #11820
parent
91a77b86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
hacking/test-module
+8
-5
No files found.
hacking/test-module
View file @
53ae3266
...
@@ -112,7 +112,11 @@ def boilerplate_module(modfile, args, interpreter, check, destfile):
...
@@ -112,7 +112,11 @@ def boilerplate_module(modfile, args, interpreter, check, destfile):
complex_args
=
utils_vars
.
combine_vars
(
complex_args
,
loader
.
load
(
args
))
complex_args
=
utils_vars
.
combine_vars
(
complex_args
,
loader
.
load
(
args
))
args
=
''
args
=
''
inject
=
{}
if
args
:
parsed_args
=
parse_kv
(
args
)
complex_args
=
utils_vars
.
combine_vars
(
complex_args
,
parsed_args
)
task_vars
=
{}
if
interpreter
:
if
interpreter
:
if
'='
not
in
interpreter
:
if
'='
not
in
interpreter
:
print
'interpreter must by in the form of ansible_python_interpreter=/usr/bin/python'
print
'interpreter must by in the form of ansible_python_interpreter=/usr/bin/python'
...
@@ -122,16 +126,15 @@ def boilerplate_module(modfile, args, interpreter, check, destfile):
...
@@ -122,16 +126,15 @@ def boilerplate_module(modfile, args, interpreter, check, destfile):
interpreter_type
=
'ansible_
%
s'
%
interpreter_type
interpreter_type
=
'ansible_
%
s'
%
interpreter_type
if
not
interpreter_type
.
endswith
(
'_interpreter'
):
if
not
interpreter_type
.
endswith
(
'_interpreter'
):
interpreter_type
=
'
%
s_interpreter'
%
interpreter_type
interpreter_type
=
'
%
s_interpreter'
%
interpreter_type
inject
[
interpreter_type
]
=
interpreter_path
task_vars
[
interpreter_type
]
=
interpreter_path
if
check
:
if
check
:
complex_args
[
'CHECKMODE'
]
=
True
complex_args
[
'CHECKMODE'
]
=
True
(
module_data
,
module_style
,
shebang
)
=
module_common
.
modify_module
(
(
module_data
,
module_style
,
shebang
)
=
module_common
.
modify_module
(
modfile
,
modfile
,
complex_args
,
complex_args
,
args
,
task_vars
=
task_vars
inject
)
)
modfile2_path
=
os
.
path
.
expanduser
(
destfile
)
modfile2_path
=
os
.
path
.
expanduser
(
destfile
)
...
...
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