summaryrefslogtreecommitdiff
path: root/mirrors/management
diff options
context:
space:
mode:
Diffstat (limited to 'mirrors/management')
-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)