def __network_ping(self):
try:
repourl = urljoin(self.get_depot_url(),
"versions/0")
# Disable SSL peer verification, we just want to check
# if the depot is running.
url = urlopen(repourl,
context=ssl._create_unverified_context())
url.close()
except HTTPError as e:
# Server returns NOT_MODIFIED if catalog is up
# to date
if e.code == http_client.NOT_MODIFIED:
return True
else:
return False
except URLError as e:
return False
return True
评论列表
文章目录