]> git.saurik.com Git - apt.git/blob - cmdline/apt-report-mirror-failure
deal with umask only if we really need to for mkstemp
[apt.git] / cmdline / apt-report-mirror-failure
1 #!/usr/bin/python
2 #
3 # This is a stub that is meant to support failure reporting of
4 # mirrors to a central database
5 #
6 # its currently not used
7
8 import sys
9 import urllib
10 import apt_pkg
11
12 apt_pkg.init()
13 url = apt_pkg.Config.find("Acquire::Mirror::ReportFailures", "")
14 #"http://people.ubuntu.com:9000/mirror-failure")
15 #"http://localhost:9000/mirror-failure")
16 if not url:
17 sys.exit(0)
18
19 print "Reporting mirror failure to '%s'" % url
20
21 data = {}
22 data['mirror'] = sys.argv[1]
23 data['failurl'] = sys.argv[2]
24 data['error'] = sys.argv[3]
25 f = urllib.urlopen(url, urllib.urlencode(data))
26 f.read()
27 f.close()
28
29