X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2Fregister_peer_object.py;h=68b3105c85beea65aace270b4882887065056077;hb=3d7237fa0b5f2b4a60cb97c7fb3b6aecfd94558a;hp=df1fa9434f9a925df54374fe86331e010444f811;hpb=acae426433020998d0d45ed25584ebed0591d036;p=sfa.git diff --git a/sfa/methods/register_peer_object.py b/sfa/methods/register_peer_object.py index df1fa943..68b3105c 100644 --- a/sfa/methods/register_peer_object.py +++ b/sfa/methods/register_peer_object.py @@ -5,11 +5,11 @@ from sfa.trust.certificate import Keypair, convert_public_key from sfa.trust.gid import * from sfa.util.faults import * -from sfa.util.misc import * +from sfa.util.namespace import * from sfa.util.method import Method from sfa.util.parameter import Parameter, Mixed -from sfa.util.record import GeniRecord -from sfa.util.genitable import GeniTable +from sfa.util.record import SfaRecord +from sfa.util.table import SfaTable from sfa.util.debug import log from sfa.trust.auth import Auth from sfa.trust.gid import create_uuid @@ -18,7 +18,7 @@ from sfa.trust.credential import Credential class register_peer_object(Method): """ Register a peer object with the registry. In addition to being stored in the - Geni database, the appropriate records will also be created in the + SFA database, the appropriate records will also be created in the PLC databases @param cred credential string @@ -32,7 +32,7 @@ class register_peer_object(Method): Parameter(str, "Credential string"), Parameter(dict, "Record dictionary containing record fields"), Mixed(Parameter(str, "Human readable name of the original caller"), - Paramater(None, "Origin hrn not specified")) + Parameter(None, "Origin hrn not specified")) ] returns = Parameter(int, "1 if successful") @@ -51,16 +51,16 @@ class register_peer_object(Method): # make sure this is a peer record if 'peer_authority' not in record_dict or \ not record_dict['peer_authority']: - raise GeniInvalidArgument, "peer_authority must be specified" + raise SfaInvalidArgument, "peer_authority must be specified" - record = GeniRecord(dict = record_dict) + record = SfaRecord(dict = record_dict) type, hrn, peer_authority = record['type'], record['hrn'], record['peer_authority'] record['authority'] = get_authority(record['hrn']) # verify permissions self.api.auth.verify_cred_is_me(cred) # check if record already exists - table = GeniTable() + table = SfaTable() existing_records = table.find({'type': type, 'hrn': hrn, 'peer_authority': peer_authority}) if existing_records: for existing_record in existing_records: