From 68e21aa4b0c7bc3e0b0437aa02161b392ae32219 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 21 Aug 2014 16:24:21 -0400 Subject: [PATCH] Add comments about what these new functions do. --- lib/ansible/utils/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 3211a62ec6b..155dbd17a18 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -353,6 +353,9 @@ def path_dwim_relative(original, dirname, source, playbook_base, check=True): return source2 # which does not exist def repo_url_to_role_name(repo_url): + # gets the role name out of a repo like + # http://git.example.com/repos/repo.git" => "repo" + if '://' not in repo_url: return repo_url trailing_path = repo_url.split('/')[-1] @@ -366,6 +369,16 @@ def repo_url_to_role_name(repo_url): def role_spec_parse(role_spec): + # takes a repo and a version like + # git+http://git.example.com/repos/repo.git,v1.0 + # and returns a list of properties such as: + # { + # 'scm': 'git', + # 'src': 'http://git.example.com/repos/repo.git', + # 'version': 'v1.0', + # 'name': 'repo' + # } + role_spec = role_spec.strip() role_version = '' if role_spec == "" or role_spec.startswith("#"):