diff options
author | Arun Raghavan <ford_prefect@gentoo.org> | 2009-01-10 23:13:49 +0530 |
---|---|---|
committer | Arun Raghavan <ford_prefect@gentoo.org> | 2009-01-10 23:13:49 +0530 |
commit | cd2ce78a3583fd9673905e9d9ba503483cec0f8b (patch) | |
tree | 9d41fbcb9c4769fd1d0a20dac9c6778bc92af5d6 /gard-v2.py | |
parent | Switch gentoo-portage checking to PortageCheck (diff) | |
download | gard-cd2ce78a3583fd9673905e9d9ba503483cec0f8b.tar.gz gard-cd2ce78a3583fd9673905e9d9ba503483cec0f8b.tar.bz2 gard-cd2ce78a3583fd9673905e9d9ba503483cec0f8b.zip |
Add rsync URL support to DistfilesCheck, and some minor changes
Diffstat (limited to 'gard-v2.py')
-rwxr-xr-x | gard-v2.py | 45 |
1 files changed, 11 insertions, 34 deletions
@@ -17,7 +17,7 @@ import urllib2 import check -rmaxlag=45 +rmaxlag = 45 * 60 dmaxlag = 5.5 * 3600 relmaxlag = 2 * 3600 @@ -89,7 +89,12 @@ for line in file: handler = add_handler(fname) info4=grsync+" wants to be a gentoo-portage mirror and is being checked as per Bug #"+bugnum logging.info(info4) + addy = 'rsync://%s/' % addy check.PortageCheck(addy).check(rmaxlag) + + bugurl1 = "Bug URL : https://bugs.gentoo.org/"+bugnum+" , "+duedate + logging.info(bugurl1) + # New line for the prettiness logging.info('') remove_handler(handler) @@ -154,43 +159,15 @@ for line in file: else: os.makedirs(reportpath) add_handler(fname) + info7 = addy+" wants to be an source mirror and is being checked as per Bug #"+bugnum+ " over rsync" logging.info(info7) - target=drsync+"/distfiles/timestamp.x" - retcode4=subprocess.call(['rsync','-aqP','--no-motd','--contimeout=30',target,'.']) - lag=False - ots='Unknown' - if retcode4 > 0: - logging.error("return value of rsync during distfiles check was "+str(retcode4)) - else: - temp=open('timestamp.x','r') - ots=temp.readline() - temp.close() - os.unlink('timestamp.x') - try: - t1=ots.split()[0] - lag=(time.time()-t1)/(60*60) - except: - t1=False - lag=False - - # Unique line first - if t1 is False or lag is False: - error7 = "Mirror is not reachable or has a corrupt timestamp." - logging.error(error7) - elif lag > dmaxlag: - error7 = "Mirror is lagging by over %.1f hours, difference is : %.2f hours" % (dmaxlag, lag) - logging.error(error7) - else: - info7 = addy+" is in sync, current lag : %.2f hours" % (lag) - logging.info(info7) - + + addy = 'rsync://%s/' % addy + check.DistfilesCheck(addy).check(dmaxlag) + # Now common lines - tstamp7 = "Timestamp on Mirror : "+str(ots).strip() - curtime7= "Current time in UTC : "+str(time.strftime("%s %a, %d %b %Y %H:%M:%S +0000", time.gmtime())) bugurl7 = "Bug URL : https://bugs.gentoo.org/"+bugnum+" , "+duedate - logging.info(tstamp7) - logging.info(curtime7) logging.info(bugurl7) # New line for the prettiness |