1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 18:06:13 +01:00

Print http debugging to stderr.

This commit is contained in:
Michal Čihař 2010-08-30 13:13:20 +02:00
parent c88d7fc4a3
commit 48da9e2b71
2 changed files with 6 additions and 9 deletions

View File

@ -2036,9 +2036,7 @@ def http_request(method, url, headers={}, data=None, file=None, timeout=100):
filefd = None
if conf.config['http_debug']:
print
print
print '--', method, url
print >>sys.stderr, '\n\n--', method, url
if method == 'POST' and not file and not data:
# adding data to an urllib2 request transforms it into a POST

View File

@ -92,10 +92,9 @@ class Fetcher:
mg = MirrorGroup(self.gr, pac.urllist, failure_callback=(self.failureReport,(),{}))
if self.http_debug:
print
print 'URLs to try for package \'%s\':' % pac
print '\n'.join(pac.urllist)
print
print >>sys.stderr, '\nURLs to try for package \'%s\':' % pac
print >>sys.stderr, '\n'.join(pac.urllist)
print >>sys.stderr
(fd, tmpfile) = tempfile.mkstemp(prefix='osc_build')
try:
@ -229,8 +228,8 @@ class Fetcher:
sys.exit(0)
except URLGrabError, e:
if self.http_debug:
print "can't fetch key for %s: %s" %(i, e.strerror)
print "url: %s" % url
print >>sys.stderr, "can't fetch key for %s: %s" %(i, e.strerror)
print >>sys.stderr, "url: %s" % url
if os.path.exists(dest):
os.unlink(dest)