summaryrefslogtreecommitdiff
path: root/cmdline/apt-report-mirror-failure
blob: 70b16cf4feb6f016328c7585c7c040f7d730d247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python

import sys
import urllib
import apt_pkg

print "apt-report-mirror-failure"

apt_pkg.init()
url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures",
                          "http://people.ubuntu.com:9000/mirror-failure")
                          #"http://localhost:9000/mirror-failure")
if not url:
    sys.exit(0)

data = {}
data['url'] = sys.argv[1]
data['error'] = sys.argv[2]
f = urllib.urlopen(url, urllib.urlencode(data))
f.read()
f.close()