From: Tony Mack Date: Wed, 12 Aug 2009 20:32:16 +0000 (+0000) Subject: dont raise the excpetion X-Git-Tag: sfa-0.9-1~90 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2eb0f4f09e3a876adea748deada0db84bbe0148c;p=sfa.git dont raise the excpetion --- diff --git a/sfa/methods/resolve.py b/sfa/methods/resolve.py index 1d3c3b33..28d6d290 100644 --- a/sfa/methods/resolve.py +++ b/sfa/methods/resolve.py @@ -70,7 +70,6 @@ class resolve(Method): self.api.fill_record_info(record) good_records.append(dict(record)) except PlanetLabRecordDoesNotExist: - raise # silently drop the ones that are missing in PL print >> log, "ignoring geni record ", record.get_name(), \ " because pl record does not exist" diff --git a/sfa/plc/sfaImport.py b/sfa/plc/sfaImport.py index cbfec5cb..4a321807 100644 --- a/sfa/plc/sfaImport.py +++ b/sfa/plc/sfaImport.py @@ -87,8 +87,7 @@ class sfaImport: AuthHierarchy = self.AuthHierarchy auth_info = AuthHierarchy.get_auth_info(auth_name) - table = GeniTable(hrn=auth_name, - cninfo=auth_info.get_dbinfo()) + table = GeniTable(cninfo=auth_info.get_dbinfo()) # if the table doesn't exist, then it means we haven't put any records # into this authority yet. diff --git a/sfa/trust/certificate.py b/sfa/trust/certificate.py index 9480f7af..5a322430 100644 --- a/sfa/trust/certificate.py +++ b/sfa/trust/certificate.py @@ -516,14 +516,14 @@ class Certificate: # until a certificate is found that is signed by a trusted root. # TODO: verify expiration time - print "====Verify Chain=====" + #print "====Verify Chain=====" # if this cert is signed by a trusted_cert, then we are set for trusted_cert in trusted_certs: - print "***************" + #print "***************" # TODO: verify expiration of trusted_cert ? - print "CLIENT CERT", self.dump() - print "TRUSTED CERT", trusted_cert.dump() - print "Client is signed by Trusted?", self.is_signed_by_cert(trusted_cert) + #print "CLIENT CERT", self.dump() + #print "TRUSTED CERT", trusted_cert.dump() + #print "Client is signed by Trusted?", self.is_signed_by_cert(trusted_cert) if self.is_signed_by_cert(trusted_cert): #print self.get_subject(), "is signed by a root" return diff --git a/sfa/util/genitable.py b/sfa/util/genitable.py index 2025fe9a..942848f4 100644 --- a/sfa/util/genitable.py +++ b/sfa/util/genitable.py @@ -17,14 +17,11 @@ from sfa.util.debug import * class GeniTable: - GENI_TABLE_PREFIX = "sfa$" + GENI_TABLE_PREFIX = "sfa" - def __init__(self, create=False, hrn="unspecified.default.registry", cninfo=None): + def __init__(self, create=False, cninfo=None): - self.hrn = hrn - - # pgsql doesn't like table names with "." in them, to replace it with "$" - self.tablename = GeniTable.GENI_TABLE_PREFIX + self.hrn.replace(".", "$") + self.tablename = GeniTable.GENI_TABLE_PREFIX # establish a connection to the pgsql server self.cnx = DB(cninfo['dbname'], cninfo['address'], port=cninfo['port'], user=cninfo['user'], passwd=cninfo['password']) @@ -42,9 +39,13 @@ class GeniTable: return False def create(self): + seln't like table names with "." in them, to + + # pgsql doesn't like table names with "." in them, to.hrn = hrn querystr = "CREATE TABLE " + self.tablename + " ( \ key text, \ + authority text, \ hrn text, \ gid text, \ type text, \ @@ -53,7 +54,7 @@ class GeniTable: last_updated timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP);" template = "CREATE INDEX %s_%s_idx ON %s (%s);" indexes = [template % ( self.tablename, field, self.tablename, field) \ - for field in ['key', 'hrn', 'type','pointer']] + for field in ['key', 'authority', 'hrn', 'type','pointer']] # IF EXISTS doenst exist in postgres < 8.2 try: self.cnx.query('DROP TABLE IF EXISTS ' + self.tablename)