def check_host_url(self, ssl_verify):
"""
Check if host url is valid
Args:
ssl_verify (bool/str): Whether or not to verify SSL certificates,
or a path to a CA file to use.
Returns:
true/false(bool): Returns true if url is valid else false
"""
log.debug('Checking if host URL %s is correct', self.url)
try:
response = self.get_response(method='GET', url=self.url,
ssl_verify=ssl_verify)
if response.status_code == 200:
return True
else:
raise ValueError('Host URL is incorrectly configured'
' in config file.')
except (ValueError, requests.ConnectionError):
raise ValueError('Host URL is incorrectly configured'
' in config file.')
except:
raise
评论列表
文章目录