X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fimporter%2Fsfaimporter.py;h=bc1ea0a896db39b1a610ba652a95a243ceeb9709;hb=2f476496067b5898c3995d81343a4a503cac8988;hp=a3376557a16e3700abec6794ef89ce2fe9c4c847;hpb=306ee139a4dcb72463c222cc17afa1d20c9daa3a;p=sfa.git diff --git a/sfa/importer/sfaimporter.py b/sfa/importer/sfaimporter.py index a3376557..bc1ea0a8 100644 --- a/sfa/importer/sfaimporter.py +++ b/sfa/importer/sfaimporter.py @@ -48,8 +48,8 @@ class SfaImporter: self.root_auth = self.config.SFA_REGISTRY_ROOT_AUTH # record options into an OptionParser - def record_options (self, parser): - self.logger.info ("SfaImporter.record_options : to do") + def add_options (self, parser): + # no generic option pass def run (self, options): @@ -94,11 +94,8 @@ class SfaImporter: self.auth_hierarchy.create_top_level_auth(hrn) # create the db record if it doesnt already exist auth_info = self.auth_hierarchy.get_auth_info(hrn) - auth_record = RegAuthority() - auth_record.type='authority' - auth_record.hrn=hrn - auth_record.gid=auth_info.get_gid_object() - auth_record.authority=get_authority(hrn) + auth_record = RegAuthority(hrn=hrn, gid=auth_info.get_gid_object(), + authority=get_authority(hrn)) auth_record.just_created() dbsession.add (auth_record) dbsession.commit() @@ -115,11 +112,8 @@ class SfaImporter: self.auth_hierarchy.create_auth(urn) auth_info = self.auth_hierarchy.get_auth_info(hrn) - user_record = RegUser() - user_record.type='user' - user_record.hrn=hrn - user_record.gid=auth_info.get_gid_object() - user_record.authority=get_authority(hrn) + user_record = RegUser(hrn=hrn, gid=auth_info.get_gid_object(), + authority=get_authority(hrn)) user_record.just_created() dbsession.add (user_record) dbsession.commit() @@ -139,11 +133,8 @@ class SfaImporter: gid = self.auth_hierarchy.create_gid(urn, create_uuid(), pkey) # xxx this should probably use a RegAuthority, or a to-be-defined RegPeer object # but for now we have to preserve the authority+<> stuff - interface_record = RegAuthority() - interface_record.type=type - interface_record.hrn=hrn - interface_record.gid= gid - interface_record.authority=get_authority(hrn) + interface_record = RegAuthority(type=type, hrn=hrn, gid=gid, + authority=get_authority(hrn)) interface_record.just_created() dbsession.add (interface_record) dbsession.commit()