diff options
author | Arun Raghavan <ford_prefect@gentoo.org> | 2008-12-28 00:22:48 +0530 |
---|---|---|
committer | Arun Raghavan <ford_prefect@gentoo.org> | 2008-12-28 00:22:48 +0530 |
commit | 453d6d613b1e4a5708d82ee29390d57a4174e0bd (patch) | |
tree | e9a230898cdf8ba95ba513f143874570596733c1 | |
parent | Add support for distfiles over rsync - to be tested (diff) | |
download | gard-453d6d613b1e4a5708d82ee29390d57a4174e0bd.tar.gz gard-453d6d613b1e4a5708d82ee29390d57a4174e0bd.tar.bz2 gard-453d6d613b1e4a5708d82ee29390d57a4174e0bd.zip |
Switch gentoo-portage checking to PortageCheck
-rwxr-xr-x | gard-v2.py | 33 |
1 files changed, 3 insertions, 30 deletions
@@ -89,36 +89,7 @@ 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) - target=grsync+"::gentoo-portage/metadata/timestamp.chk" - retcode=subprocess.call(['rsync','-aqP','--no-motd','--contimeout=30',target,'.']) - if retcode > 0: - logging.error("return value of rsync during gentoo-portage check was "+str(retcode)) - else: - temp=open('timestamp.chk','r') - ots=temp.readline() - temp.close() - #Keep timestamp as Fri, 04 Jul 2008 20:45:01, remove the +0000 since there doesn't seem to be a %z in python - t1=time.mktime(time.strptime(ots.replace(" +0000",""), "%a, %d %b %Y %H:%M:%S ")) - lag=(time.mktime(time.gmtime())-t1)/60 - if lag > rmaxlag: - error4 = "gentoo-portage mirror is lagging by over 40 mins, lag is : "+str(round(lag,2))+" mins" - tstamp4 = "Timestamp on Mirror : "+str(ots).strip() - curtime4 = "Current time in UTC : "+str(time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime())) - bugurl4 = "Bug URL : https://bugs.gentoo.org/"+bugnum+" , "+duedate - logging.error(error4) - logging.info(tstamp4) - logging.info(curtime4) - logging.info(bugurl4) - else: - info4 = grsync+" is in sync, current delta : "+str(round(lag,2))+" mins" - tstamp4 = "Timestamp on Mirror : "+str(ots) - curtime4= "Current time in UTC : "+str(time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime())) - bugurl4 = "Bug URL : https://bugs.gentoo.org/"+bugnum+" , "+duedate - logging.info(info4) - logging.info(tstamp4) - logging.info(curtime4) - logging.info(bugurl4) - os.unlink('timestamp.chk') + check.PortageCheck(addy).check(rmaxlag) # New line for the prettiness logging.info('') remove_handler(handler) @@ -175,6 +146,8 @@ for line in file: logging.info('') remove_handler(handler) if len(drsync) > 0: + # Replace with check.DistfilesCheck(drsyync).check() + # after testing fname=reportpath+"/"+addy if os.path.isdir(reportpath): pass |