aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2013-10-19 01:59:34 -0700
committerBrian Dolbec <dolsen@gentoo.org>2013-10-19 02:04:49 -0700
commitea6eac96004ede150a3a1acdb7a83d67b34c8390 (patch)
tree52ab85b51485c067eb3f00053bb92276aee7544b
parentMove the TimeoutException and handler out of the Deep class's deeptime(). (diff)
downloadmirrorselect-ea6eac96004ede150a3a1acdb7a83d67b34c8390.tar.gz
mirrorselect-ea6eac96004ede150a3a1acdb7a83d67b34c8390.tar.bz2
mirrorselect-ea6eac96004ede150a3a1acdb7a83d67b34c8390.zip
Improve debug print statements.
-rw-r--r--mirrorselect/extractor.py2
-rwxr-xr-xmirrorselect/main.py6
-rw-r--r--mirrorselect/selectors.py6
3 files changed, 8 insertions, 6 deletions
diff --git a/mirrorselect/extractor.py b/mirrorselect/extractor.py
index 2b7d049..3a113fb 100644
--- a/mirrorselect/extractor.py
+++ b/mirrorselect/extractor.py
@@ -68,7 +68,7 @@ class Extractor(object):
self.hosts = self.filter_hosts(filters, self.unfiltered_hosts)
- self.output.write('Extractor(): fetched mirrors.xml,'
+ self.output.write('Extractor(): fetched mirrors,'
' %s hosts after filtering\n' % len(self.hosts), 2)
diff --git a/mirrorselect/main.py b/mirrorselect/main.py
index 5844a65..0e41f30 100755
--- a/mirrorselect/main.py
+++ b/mirrorselect/main.py
@@ -292,10 +292,10 @@ class MirrorSelect(object):
@rtype: list
'''
if options.rsync:
- self.output.write("using url: %s" % MIRRORS_RSYNC_DATA, 2)
+ self.output.write("using url: %s\n" % MIRRORS_RSYNC_DATA, 2)
hosts = Extractor(MIRRORS_RSYNC_DATA, options, self.output).hosts
else:
- self.output.write("using url: %s" % MIRRORS_3_XML, 2)
+ self.output.write("using url: %s\n" % MIRRORS_3_XML, 2)
hosts = Extractor(MIRRORS_3_XML, options, self.output).hosts
return hosts
@@ -353,7 +353,7 @@ class MirrorSelect(object):
config_path = self.get_conf_path(options.rsync)
self.output.write("main(); reset config_path = %s\n" % config_path, 2)
else:
- self.output.write("main(); rsync = %s" % str(options.rsync),2)
+ self.output.write("main(); rsync = %s\n" % str(options.rsync),2)
fsmirrors = get_filesystem_mirrors(self.output,
config_path, options.rsync)
diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py
index 581cbd5..a3d0baf 100644
--- a/mirrorselect/selectors.py
+++ b/mirrorselect/selectors.py
@@ -306,6 +306,7 @@ class Deep(object):
self.output.write('deeptime(): unable to resolve ip for host %s\n' % url_parts.hostname, 2)
return (None, True)
+ self.output.write("deeptime(): ip's for host %s: %s\n" % (url_parts.hostname, str(ips)), 2)
delta = 0
f = None
@@ -343,14 +344,15 @@ class Deep(object):
finally:
signal.alarm(0)
except EnvironmentError as e:
- self.output.write(('deeptime(): close connection to host %s ' + \
+ self.output.write(('deeptime(): closing connection to host %s ' + \
'failed for ip %s: %s\n') % \
(url_parts.hostname, ip, e), 2)
except TimeoutException:
- self.output.write(('deeptime(): close connection to host %s ' + \
+ self.output.write(('deeptime(): closing connection to host %s ' + \
'timed out for ip %s\n') % \
(url_parts.hostname, ip), 2)
+ self.output.write('deeptime(): timing url: %s\n' % test_url, 2)
try:
# The first connection serves to "wake up" the route between
# the local and remote machines. A second connection is used