From 3fab0c5b849a53e67450af335c686a647228258a Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 3 Nov 2011 10:24:20 +0100 Subject: [PATCH] hardwire SfaTable as the storage system for now --- sfa/plc/pldriver.py | 12 +++++++++--- sfa/server/sfaapi.py | 12 +++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sfa/plc/pldriver.py b/sfa/plc/pldriver.py index eecbadb4..af3b213e 100644 --- a/sfa/plc/pldriver.py +++ b/sfa/plc/pldriver.py @@ -23,7 +23,9 @@ class PlDriver (PlShell): PlShell.__init__ (self, config) self.hrn = config.SFA_INTERFACE_HRN - self.SfaTable = SfaTable + # xxx thgen fixme - use SfaTable hardwired for now + # will need to extend generic to support multiple storage systems + #self.SfaTable = SfaTable # Initialize the PLC shell only if SFA wraps a myPLC rspec_type = config.get_aggregate_type() assert (rspec_type == 'pl' or rspec_type == 'vini' or \ @@ -266,7 +268,9 @@ class PlDriver (PlShell): # we obtain # get the sfa records - table = self.SfaTable() + # xxx thgen fixme - use SfaTable hardwired for now + # table = self.SfaTable() + table = SfaTable() person_list, persons = [], {} person_list = table.find({'type': 'user', 'pointer': person_ids}) # create a hrns keyed on the sfa record's pointer. @@ -366,7 +370,9 @@ class PlDriver (PlShell): # build a list of the new person ids, by looking up each person to get # their pointer newIdList = [] - table = self.SfaTable() + # xxx thgen fixme - use SfaTable hardwired for now + #table = self.SfaTable() + table = SfaTable() records = table.find({'type': 'user', 'hrn': newList}) for rec in records: newIdList.append(rec['pointer']) diff --git a/sfa/server/sfaapi.py b/sfa/server/sfaapi.py index a76637df..70850379 100644 --- a/sfa/server/sfaapi.py +++ b/sfa/server/sfaapi.py @@ -1,4 +1,4 @@ -import os.path +import os, os.path import datetime from sfa.util.faults import SfaAPIError @@ -9,10 +9,10 @@ from sfa.trust.certificate import Keypair, Certificate from sfa.trust.credential import Credential from sfa.trust.rights import determine_rights -# this is wrong all right, but temporary, will use generic from sfa.server.xmlrpcapi import XmlrpcApi -import os -import datetime + +# thgen xxx fixme this is wrong all right, but temporary, will use generic +from sfa.util.table import SfaTable #################### class SfaApi (XmlrpcApi): @@ -158,7 +158,9 @@ class SfaApi (XmlrpcApi): if not auth_hrn or hrn == self.config.SFA_INTERFACE_HRN: auth_hrn = hrn auth_info = self.auth.get_auth_info(auth_hrn) - table = self.SfaTable() + # xxx thgen fixme - use SfaTable hardwired for now + #table = self.SfaTable() + table = SfaTable() records = table.findObjects({'hrn': hrn, 'type': 'authority+sa'}) if not records: raise RecordNotFound -- 2.47.0