Corrected bug where role_path was wrong for roles in subdirectories

Fixed role name for
    - { role: 'lives/in/a/subdirectory' }
Should be 'lives/in/a/subdirectory', not just 'subdirectory'
This commit is contained in:
Will Thames 2014-08-20 17:50:06 +10:00 committed by Michael DeHaan
commit 6e9abefc11
2 changed files with 8 additions and 5 deletions

View file

@ -353,6 +353,8 @@ 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):
if '://' not in repo_url:
return repo_url
trailing_path = repo_url.split('/')[-1]
if trailing_path.endswith('.git'):
trailing_path = trailing_path[:-4]