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
b551eba6
Commit
b551eba6
authored
Jul 07, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment uncommented methods in utils
parent
74947255
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
lib/ansible/utils.py
+5
-1
No files found.
lib/ansible/utils.py
View file @
b551eba6
...
@@ -58,6 +58,7 @@ def smjson(result):
...
@@ -58,6 +58,7 @@ def smjson(result):
return
json
.
dumps
(
result2
,
sort_keys
=
True
)
return
json
.
dumps
(
result2
,
sort_keys
=
True
)
def
task_start_msg
(
name
,
conditional
):
def
task_start_msg
(
name
,
conditional
):
# FIXME: move to callbacks code
if
conditional
:
if
conditional
:
return
"NOTIFIED: [
%
s]"
%
name
return
"NOTIFIED: [
%
s]"
%
name
else
:
else
:
...
@@ -166,6 +167,7 @@ def path_dwim(basedir, given):
...
@@ -166,6 +167,7 @@ def path_dwim(basedir, given):
return
os
.
path
.
join
(
basedir
,
given
)
return
os
.
path
.
join
(
basedir
,
given
)
def
json_loads
(
data
):
def
json_loads
(
data
):
''' parse a JSON string and return a data structure '''
return
json
.
loads
(
data
)
return
json
.
loads
(
data
)
def
parse_json
(
data
):
def
parse_json
(
data
):
...
@@ -220,9 +222,9 @@ def _varLookup(name, vars):
...
@@ -220,9 +222,9 @@ def _varLookup(name, vars):
return
space
return
space
_KEYCRE
=
re
.
compile
(
r"\$(?P<complex>\{){0,1}((?(complex)[\w\.\[\]]+|\w+))(?(complex)\})"
)
_KEYCRE
=
re
.
compile
(
r"\$(?P<complex>\{){0,1}((?(complex)[\w\.\[\]]+|\w+))(?(complex)\})"
)
# if { -> complex if complex, allow . and need trailing }
def
varLookup
(
varname
,
vars
):
def
varLookup
(
varname
,
vars
):
''' helper function used by varReplace '''
m
=
_KEYCRE
.
search
(
varname
)
m
=
_KEYCRE
.
search
(
varname
)
if
not
m
:
if
not
m
:
return
None
return
None
...
@@ -288,9 +290,11 @@ def template_from_file(basedir, path, vars, setup_cache):
...
@@ -288,9 +290,11 @@ def template_from_file(basedir, path, vars, setup_cache):
return
template
(
res
,
vars
,
setup_cache
)
return
template
(
res
,
vars
,
setup_cache
)
def
parse_yaml
(
data
):
def
parse_yaml
(
data
):
''' convert a yaml string to a data structure '''
return
yaml
.
load
(
data
)
return
yaml
.
load
(
data
)
def
parse_yaml_from_file
(
path
):
def
parse_yaml_from_file
(
path
):
''' convert a yaml file to a data structure '''
try
:
try
:
data
=
file
(
path
)
.
read
()
data
=
file
(
path
)
.
read
()
except
IOError
:
except
IOError
:
...
...
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