apt-report-mirror-failure 650 B

123456789101112131415161718192021222324252627282930
  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. import sys
  8. import urllib
  9. import apt_pkg
  10. apt_pkg.init()
  11. url = apt_pkg.Config.find("Acquire::Mirror::ReportFailures", "")
  12. #"http://people.ubuntu.com:9000/mirror-failure")
  13. #"http://localhost:9000/mirror-failure")
  14. if not url:
  15. sys.exit(0)
  16. print "Reporting mirror failure to '%s'" % url
  17. data = {}
  18. data['mirror'] = sys.argv[1]
  19. data['failurl'] = sys.argv[2]
  20. data['error'] = sys.argv[3]
  21. f = urllib.urlopen(url, urllib.urlencode(data))
  22. f.read()
  23. f.close()