from sfa.trust.gid import create_uuid
from sfa.storage.table import SfaTable
from sfa.storage.record import SfaRecord
-from sfa.storage.table import SfaTable
def _un_unicode(str):
def __init__(self):
self.logger = _SfaLogger(logfile='/var/log/sfa_import.log', loggername='importlog')
self.AuthHierarchy = Hierarchy()
- self.table = SfaTable()
+# self.table = SfaTable()
self.config = Config()
self.TrustedRoots = TrustedRoots(Config.get_trustedroots_dir(self.config))
self.root_auth = self.config.SFA_REGISTRY_ROOT_AUTH
- # should use a driver instead...
- from sfa.plc.plshell import PlShell
- # how to connect to planetlab
- self.shell = PlShell (self.config)
def create_top_level_records(self):
"""
# create the db record if it doesnt already exist
auth_info = self.AuthHierarchy.get_auth_info(hrn)
auth_record = SfaRecord(hrn=hrn, gid=auth_info.get_gid_object(), type="authority", pointer=-1, authority=get_authority(hrn))
- auth_record.sync(verbose=True)
+ self.logger.info("Import: importing %s " % auth_record.summary_string())
+ auth_record.sync()
def create_sm_client_record(self):
"""
auth_info = self.AuthHierarchy.get_auth_info(hrn)
record = SfaRecord(hrn=hrn, gid=auth_info.get_gid_object(), \
type="user", pointer=-1, authority=get_authority(hrn))
- record.sync(verbose=True)
+ self.logger.info("Import: importing %s " % record.summary_string())
+ record.sync()
def create_interface_records(self):
"""
gid = self.AuthHierarchy.create_gid(urn, create_uuid(), pkey)
interface_record = SfaRecord(hrn=hrn, type=interface, pointer=-1,
gid = gid, authority=get_authority(hrn))
- interface_record.sync(verbose=True)
+ self.logger.info("Import: importing %s " % interface_record.summary_string())
+ interface_record.sync()
def delete_record(self, hrn, type):
# delete the record