ci_watson/artifactory_helpers.py
def check_url(url):
    """Determine if URL can be resolved without error."""
    if RE_URL.match(url) is None:
        return False

    # Optional import: requests is not needed for local big data setup.
    import requests

    # requests.head does not work with Artifactory landing page.
    r = requests.get(url, allow_redirects=True)
    # TODO: Can we simply return r.ok here?
    if r.status_code >= 400:
        return False
    return True
Determine if URL can be resolved without error.
Determine if URL can be resolved without error.
Determine if URL can be resolved without error .
def check_url(url):
    if RE_URL.match(url) is None:
        return False
    import requests
    r = requests.get(url, allow_redirects=True)
    if r.status_code >= 400:
        return False
    return True
def check_url ( url ) : if RE_URL . match ( url ) is None : return False import requests r = requests . get ( url , allow_redirects = True ) if r . status_code >= 400 : return False return True
Determine if URL can be resolved without error.
Determine if URL can be resolved without error .
"""Determine if URL can be resolved without error.""" # Optional import: requests is not needed for local big data setup. # requests.head does not work with Artifactory landing page. # TODO: Can we simply return r.ok here?
url