mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-14 01:26:23 +01:00
Print http debugging to stderr.
This commit is contained in:
parent
c88d7fc4a3
commit
48da9e2b71
@ -2036,9 +2036,7 @@ def http_request(method, url, headers={}, data=None, file=None, timeout=100):
|
|||||||
filefd = None
|
filefd = None
|
||||||
|
|
||||||
if conf.config['http_debug']:
|
if conf.config['http_debug']:
|
||||||
print
|
print >>sys.stderr, '\n\n--', method, url
|
||||||
print
|
|
||||||
print '--', method, url
|
|
||||||
|
|
||||||
if method == 'POST' and not file and not data:
|
if method == 'POST' and not file and not data:
|
||||||
# adding data to an urllib2 request transforms it into a POST
|
# adding data to an urllib2 request transforms it into a POST
|
||||||
|
11
osc/fetch.py
11
osc/fetch.py
@ -92,10 +92,9 @@ class Fetcher:
|
|||||||
mg = MirrorGroup(self.gr, pac.urllist, failure_callback=(self.failureReport,(),{}))
|
mg = MirrorGroup(self.gr, pac.urllist, failure_callback=(self.failureReport,(),{}))
|
||||||
|
|
||||||
if self.http_debug:
|
if self.http_debug:
|
||||||
print
|
print >>sys.stderr, '\nURLs to try for package \'%s\':' % pac
|
||||||
print 'URLs to try for package \'%s\':' % pac
|
print >>sys.stderr, '\n'.join(pac.urllist)
|
||||||
print '\n'.join(pac.urllist)
|
print >>sys.stderr
|
||||||
print
|
|
||||||
|
|
||||||
(fd, tmpfile) = tempfile.mkstemp(prefix='osc_build')
|
(fd, tmpfile) = tempfile.mkstemp(prefix='osc_build')
|
||||||
try:
|
try:
|
||||||
@ -229,8 +228,8 @@ class Fetcher:
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
except URLGrabError, e:
|
except URLGrabError, e:
|
||||||
if self.http_debug:
|
if self.http_debug:
|
||||||
print "can't fetch key for %s: %s" %(i, e.strerror)
|
print >>sys.stderr, "can't fetch key for %s: %s" %(i, e.strerror)
|
||||||
print "url: %s" % url
|
print >>sys.stderr, "url: %s" % url
|
||||||
|
|
||||||
if os.path.exists(dest):
|
if os.path.exists(dest):
|
||||||
os.unlink(dest)
|
os.unlink(dest)
|
||||||
|
Loading…
Reference in New Issue
Block a user