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
4803e923
Commit
4803e923
authored
Aug 14, 2014
by
Will Thames
Committed by
Michael DeHaan
Aug 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved handling of role_version in repo_url_to_role_name
parent
1803976a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
lib/ansible/utils/__init__.py
+2
-0
test/units/TestUtils.py
+2
-1
No files found.
lib/ansible/utils/__init__.py
View file @
4803e923
...
...
@@ -356,6 +356,8 @@ def repo_url_to_role_name(repo_url):
trailing_path
=
repo_url
.
split
(
'/'
)[
-
1
]
if
trailing_path
.
endswith
(
'.git'
):
trailing_path
=
trailing_path
[:
-
4
]
if
','
in
trailing_path
:
trailing_path
=
trailing_path
.
split
(
','
)[
0
]
return
trailing_path
def
json_loads
(
data
):
...
...
test/units/TestUtils.py
View file @
4803e923
...
...
@@ -780,6 +780,7 @@ class TestUtils(unittest.TestCase):
def
test_repo_url_to_role_name
(
self
):
tests
=
[(
"http://git.example.com/repos/repo.git"
,
"repo"
),
(
"ssh://git@git.example.com:repos/role-name"
,
"role-name"
)]
(
"ssh://git@git.example.com:repos/role-name"
,
"role-name"
),
(
"ssh://git@git.example.com:repos/role-name,v0.1"
,
"role-name"
)]
for
(
url
,
result
)
in
tests
:
self
.
assertEqual
(
ansible
.
utils
.
repo_url_to_role_name
(
url
),
result
)
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