Commit 12a7f65e authored by Sébastien Luttringer's avatar Sébastien Luttringer
Browse files

Override urllib2 default user-agent

parent 856d5e87
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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