Alan Burlison wrote:
Darren J Moffat wrote:
Is it possible we could have comchk work similar to webrev does now -
in fact using the same its config files recently introduced. So that
when it is run inside SWAN it uses sac.sfbay instead of
arc.opensolaris.org ?
I don't think that would help as the data comes from the same database
on sac.eng.
Looking at this a little more I think we no longer need the cgi/arc.py
and the CSV data behind it now that arc.opensolaris.org is structured
the same way as sac.sfbay.
All that is really needed is to "stat"
http://arc.opensolaris.org/caselog/<arc>/<casenumber>. It could even be
enhanced to grab the IAM file and check that the case is actually
"closed-approved".
Looks like it should be something along the following lines in
DbLookup.py - note I'm very much a Python novice and this is cribbed
very strongly from the bugs stuff for boo.
class ARCDB(object);
"""Lookup ARC cases.
Object can be used on or off SWAN, using either sac.sfbay or
arc.opensolaris.org as a database.
Usage:
arc = ARCDB();
r = arc.lookup("PSARC/2009/171")
print r["PSARC/2009/171"]["name"]
r = arc.lookup(["PSARC/2009/171", "LSARC/2009/212"])
print r["LSARC/2009/212"]["name"]
"""
def __init__(self, priority = ("sac",), forceAoo = False):
""" Create an ARCDB object.
Keyword argument:
forceAoo: use a.o.o even from SWAN (default=False)
priority: use ARC databases in this order
"""
self.__validARCDB = ["sac"]
self.__onSWAN = not forceAoo and onSWAN()
for database in priority:
if database not in self.__validARCDB:
raise ARCDBException, database
self.__prority = priority
def __aoocase(self, case):
case = str(case)
url = "http://arc.opensolaris.org/caselog/"
req = urllib2.Request(url, urllib.urlencode({case}))
results = {}
try:
data = urllib2.urlopen(req).readlines()
except urllib2.HTTPError, e:
if e.code != 404:
print "ERROR: HTTP error at " + \
req.get_full_url() + \
" got error: " + str(e.code)
raise e
else:
raise NonExistentCase
except urllib2.URLError, e:
print "ERROR: could not connect to " + \
req.get_full_url() + \
' got error: "' + e.reason[1] + '"'
raise e
""" file in parsing of the IAM file here """
results["case"] = case
results["name"] = results.pop("name")
results["status"] = results.pop("status")
--
Darren J Moffat
_______________________________________________
website-discuss mailing list
[email protected]