Commit 12a7f65e authored by Seblu's avatar Seblu

Override urllib2 default user-agent

parent 856d5e87
......@@ -139,7 +139,10 @@ class PipeFile(object):
Open a file accross an http server
'''
try:
self.fo = urllib2.urlopen(path, timeout=self.timeout)
headers = {"User-Agent": "%s v%s" % (installsystems.canonical_name,
installsystems.version)}
request = urllib2.Request(path, None, headers)
self.fo = urllib2.urlopen(request, timeout=self.timeout)
except Exception as e:
raise ISError("Unable to open %s" % path, e)
# get file size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment