From dc95385b384961794535a669dbe5cf0f8ca5f02a Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 7 Jul 2012 08:18:33 -0400 Subject: [PATCH] Comment uncommented methods in utils --- lib/ansible/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 15adb02939a..5dc8c8349ee 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -58,6 +58,7 @@ def smjson(result): return json.dumps(result2, sort_keys=True) def task_start_msg(name, conditional): + # FIXME: move to callbacks code if conditional: return "NOTIFIED: [%s]" % name else: @@ -166,6 +167,7 @@ def path_dwim(basedir, given): return os.path.join(basedir, given) def json_loads(data): + ''' parse a JSON string and return a data structure ''' return json.loads(data) def parse_json(data): @@ -220,9 +222,9 @@ def _varLookup(name, vars): return space _KEYCRE = re.compile(r"\$(?P\{){0,1}((?(complex)[\w\.\[\]]+|\w+))(?(complex)\})") -# if { -> complex if complex, allow . and need trailing } def varLookup(varname, vars): + ''' helper function used by varReplace ''' m = _KEYCRE.search(varname) if not m: return None @@ -288,9 +290,11 @@ def template_from_file(basedir, path, vars, setup_cache): return template(res, vars, setup_cache) def parse_yaml(data): + ''' convert a yaml string to a data structure ''' return yaml.load(data) def parse_yaml_from_file(path): + ''' convert a yaml file to a data structure ''' try: data = file(path).read() except IOError: