mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Tidied up a little, added tests
Moved repo_url_to_role_name to common method in ansible.utils Added unit test for repo_url_to_role_name Added integration tests for galaxy
This commit is contained in:
parent
b550cb9bc3
commit
c2fe33f9f4
7 changed files with 38 additions and 7 deletions
|
@ -352,6 +352,12 @@ def path_dwim_relative(original, dirname, source, playbook_base, check=True):
|
|||
raise errors.AnsibleError("input file not found at %s or %s" % (source2, obvious_local_path))
|
||||
return source2 # which does not exist
|
||||
|
||||
def repo_url_to_role_name(repo_url):
|
||||
trailing_path = repo_url.split('/')[-1]
|
||||
if trailing_path.endswith('.git'):
|
||||
trailing_path = trailing_path[:-4]
|
||||
return trailing_path
|
||||
|
||||
def json_loads(data):
|
||||
''' parse a JSON string and return a data structure '''
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue