summaryrefslogtreecommitdiff
path: root/mirrors
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-08-05 23:59:03 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-08-05 23:59:03 -0600
commitd4731a373ca665d4547eb0e89cdf270d41c44243 (patch)
tree41dbfb57e5f6745ad6ac3acd5de8c4d9788c950c /mirrors
parentc8d979b8a48805d162ab46cdc4e493da0aa1595c (diff)
parent803ba89841468bcf088ea79ea981a849ca159682 (diff)
Merge branch 'archweb' into archweb-generic
Diffstat (limited to 'mirrors')
-rw-r--r--mirrors/management/commands/mirrorcheck.py7
-rw-r--r--mirrors/management/commands/mirrorresolv.py7
2 files changed, 12 insertions, 2 deletions
diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py
index 1f16a375..1a33073a 100644
--- a/mirrors/management/commands/mirrorcheck.py
+++ b/mirrors/management/commands/mirrorcheck.py
@@ -18,6 +18,7 @@ from optparse import make_option
from pytz import utc
import re
import socket
+import ssl
import subprocess
import sys
import time
@@ -57,7 +58,7 @@ class Command(NoArgsCommand):
logger.level = logging.ERROR
elif v == 1:
logger.level = logging.WARNING
- elif v == 2:
+ elif v >= 2:
logger.level = logging.DEBUG
timeout = options.get('timeout')
@@ -146,6 +147,10 @@ def check_mirror_url(mirror_url, location, timeout):
log.is_success = False
log.error = "Exception in processing HTTP request."
logger.debug("failed: %s, %s", url, log.error)
+ except ssl.CertificateError as e:
+ log.is_success = False
+ log.error = str(e)
+ logger.debug("failed: %s, %s", url, log.error)
except socket.timeout:
log.is_success = False
log.error = "Connection timed out."
diff --git a/mirrors/management/commands/mirrorresolv.py b/mirrors/management/commands/mirrorresolv.py
index 85a3c654..0e71894b 100644
--- a/mirrors/management/commands/mirrorresolv.py
+++ b/mirrors/management/commands/mirrorresolv.py
@@ -32,7 +32,7 @@ class Command(NoArgsCommand):
logger.level = logging.ERROR
elif v == 1:
logger.level = logging.WARNING
- elif v == 2:
+ elif v >= 2:
logger.level = logging.DEBUG
return resolve_mirrors()
@@ -54,6 +54,11 @@ def resolve_mirrors():
if newvals != oldvals:
logger.debug("values changed for %s", mirrorurl)
mirrorurl.save(update_fields=('has_ipv4', 'has_ipv6'))
+ except socket.gaierror, e:
+ if e.errno == socket.EAI_NONAME:
+ logger.debug("gaierror resolving %s: %s", mirrorurl.hostname, e)
+ else:
+ logger.warn("gaierror resolving %s: %s", mirrorurl.hostname, e)
except socket.error, e:
logger.warn("error resolving %s: %s", mirrorurl.hostname, e)