summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-12-22 23:05:56 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2008-12-22 23:05:56 -0800
commit1d36cf9711d8675af8a3e43839d728f1fd4fbaaa (patch)
tree145dafb22e01878cb2d977053bc4e795f4971a71
parentheader fun. (diff)
downloadgard-1d36cf9711d8675af8a3e43839d728f1fd4fbaaa.tar.gz
gard-1d36cf9711d8675af8a3e43839d728f1fd4fbaaa.tar.bz2
gard-1d36cf9711d8675af8a3e43839d728f1fd4fbaaa.zip
Remove wget usage for buglist.
-rwxr-xr-xgard-v2.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/gard-v2.py b/gard-v2.py
index ade5d36..d14c444 100755
--- a/gard-v2.py
+++ b/gard-v2.py
@@ -13,6 +13,7 @@ import os
import datetime
import subprocess
import logging
+import urllib2
import check
@@ -23,7 +24,6 @@ relmaxlag = 2 * 3600
HOME = os.getenv('HOME')
reportpath = HOME + "/gentoo/mirrors/gard/reports"
bugurl = "http://bugs.gentoo.org/buglist.cgi?query_format=advanced&product=Mirrors&status_whiteboard_type=allwordssubstr&status_whiteboard=due&bug_status=ASSIGNED&columnlist=bug_id,opendate,bug_status,resolution,short_desc,status_whiteboard&ctype=csv"
-fname = HOME + "/gentoo/open-mirror-bugs"
logformat = '%(levelname)s:\t%(message)s'
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format=logformat)
@@ -39,8 +39,10 @@ def add_handler(logfile):
def remove_handler(handler):
logging.getLogger('').removeHandler(handler)
-retcode5=subprocess.call(['/usr/bin/wget','-q','-T 30', '-O', fname, bugurl])
-file=open(fname,'r')
+_ = urllib2.urlopen(bugurl)
+file = _.readlines()
+_.close()
+
logging.debug("Initializing G(entoo)A(utomated)R(sync)D(istfiles) checker script, version 2 (Katrina) - kicking mirror ass for Gentoo")
# Format of CSV = 234083,"2008-08-06 13:01:32","ASSIGNED",,"[rsync,distfiles|all] New mirror Cambrium BV (The Netherlands)","due:2008/09/01;dist:http://mirror.cambrium.nl/pub/os/linux/gentoo/|ftp://mirror.cambrium.nl/pub/os/linux/gentoo/|rsync://mirror.cambrium.nl/gentoo/;portage:mirror.cambrium.nl"