You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
650 B

  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()