mirror of
https://github.com/ansible/ansible.git
synced 2026-05-28 04:32:20 -04:00
Merge 47bc663840 into ba21909655
This commit is contained in:
commit
23461e3de6
1 changed files with 2 additions and 1 deletions
|
|
@ -9,7 +9,8 @@ def is_uri(value, schemes=None):
|
|||
""" Will verify that the string passed is a valid 'URI', if given a list of valid schemes it will match those """
|
||||
try:
|
||||
x = urlparse(value)
|
||||
isit = all([x.scheme is not None, x.path is not None, not schemes or x.scheme in schemes])
|
||||
# urlparse returns empty string for scheme when not present, not None
|
||||
isit = all([x.scheme, x.path is not None, not schemes or x.scheme in schemes])
|
||||
except Exception as e:
|
||||
isit = False
|
||||
return isit
|
||||
|
|
|
|||
Loading…
Reference in a new issue