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
2f51f3bb
Commit
2f51f3bb
authored
Jul 17, 2015
by
Gerard Lynch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated to use new loader
parent
d70c88bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
hacking/test-module
+5
-3
No files found.
hacking/test-module
View file @
2f51f3bb
...
@@ -34,7 +34,8 @@ import os
...
@@ -34,7 +34,8 @@ import os
import
subprocess
import
subprocess
import
traceback
import
traceback
import
optparse
import
optparse
import
ansible.utils
as
utils
import
ansible.utils.vars
as
utils_vars
from
ansible.parsing
import
DataLoader
from
ansible.parsing.utils.jsonify
import
jsonify
from
ansible.parsing.utils.jsonify
import
jsonify
from
ansible.parsing.splitter
import
parse_kv
from
ansible.parsing.splitter
import
parse_kv
import
ansible.executor.module_common
as
module_common
import
ansible.executor.module_common
as
module_common
...
@@ -91,17 +92,18 @@ def boilerplate_module(modfile, args, interpreter, check):
...
@@ -91,17 +92,18 @@ def boilerplate_module(modfile, args, interpreter, check):
#module_fh.close()
#module_fh.close()
#replacer = module_common.ModuleReplacer()
#replacer = module_common.ModuleReplacer()
loader
=
DataLoader
()
#included_boilerplate = module_data.find(module_common.REPLACER) != -1 or module_data.find("import ansible.module_utils") != -1
#included_boilerplate = module_data.find(module_common.REPLACER) != -1 or module_data.find("import ansible.module_utils") != -1
complex_args
=
{}
complex_args
=
{}
if
args
.
startswith
(
"@"
):
if
args
.
startswith
(
"@"
):
# Argument is a YAML file (JSON is a subset of YAML)
# Argument is a YAML file (JSON is a subset of YAML)
complex_args
=
utils
.
combine_vars
(
complex_args
,
utils
.
parse_yaml
_from_file
(
args
[
1
:]))
complex_args
=
utils
_vars
.
combine_vars
(
complex_args
,
loader
.
load
_from_file
(
args
[
1
:]))
args
=
''
args
=
''
elif
args
.
startswith
(
"{"
):
elif
args
.
startswith
(
"{"
):
# Argument is a YAML document (not a file)
# Argument is a YAML document (not a file)
complex_args
=
utils
.
combine_vars
(
complex_args
,
utils
.
parse_yaml
(
args
))
complex_args
=
utils
_vars
.
combine_vars
(
complex_args
,
loader
.
load
(
args
))
args
=
''
args
=
''
inject
=
{}
inject
=
{}
...
...
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