From 58b434e08aad0ec7f1f200d5e968ff0dc29d4506 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Wed, 12 Oct 2016 15:29:20 -0400 Subject: [PATCH] Enable support for file scheme in SCM URLs. --- awx/main/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/awx/main/utils.py b/awx/main/utils.py index c06d0fac2d..3009bea3e4 100644 --- a/awx/main/utils.py +++ b/awx/main/utils.py @@ -244,7 +244,7 @@ def update_scm_url(scm_type, url, username=True, password=True, # SCP style before passed to git module. parts = urlparse.urlsplit('git+ssh://%s' % modified_url) # Handle local paths specified without file scheme (e.g. /path/to/foo). - # Only supported by git and hg. (not currently allowed) + # Only supported by git and hg. elif scm_type in ('git', 'hg'): if not url.startswith('/'): parts = urlparse.urlsplit('file:///%s' % url) @@ -255,9 +255,9 @@ def update_scm_url(scm_type, url, username=True, password=True, # Validate that scheme is valid for given scm_type. scm_type_schemes = { - 'git': ('ssh', 'git', 'git+ssh', 'http', 'https', 'ftp', 'ftps'), - 'hg': ('http', 'https', 'ssh'), - 'svn': ('http', 'https', 'svn', 'svn+ssh'), + 'git': ('ssh', 'git', 'git+ssh', 'http', 'https', 'ftp', 'ftps', 'file'), + 'hg': ('http', 'https', 'ssh', 'file'), + 'svn': ('http', 'https', 'svn', 'svn+ssh', 'file'), } if parts.scheme not in scm_type_schemes.get(scm_type, ()): raise ValueError('Unsupported %s URL' % scm_type)