X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=sfa%2Fmanagers%2Fregistry_manager_pl.py;h=3835873a9fecc64c3f39a8a6842936060d7ac2b3;hb=06b330f0ee047bdb107e43e82b1d7356c876bc15;hp=ac5901c846588beb3a6a11d0010ff94ddb8982e0;hpb=239b4be1e879a180c9d51ebedd0c6a6b44aef3c8;p=sfa.git diff --git a/sfa/managers/registry_manager_pl.py b/sfa/managers/registry_manager_pl.py index ac5901c8..3835873a 100644 --- a/sfa/managers/registry_manager_pl.py +++ b/sfa/managers/registry_manager_pl.py @@ -7,8 +7,8 @@ from sfa.util.record import SfaRecord from sfa.util.table import SfaTable from sfa.util.record import SfaRecord from sfa.trust.gid import GID -from sfa.util.namespace import hrn_to_pl_login_base from sfa.util.xrn import Xrn, get_leaf, get_authority, hrn_to_urn, urn_to_hrn +from sfa.util.plxrn import hrn_to_pl_login_base from sfa.trust.credential import Credential from sfa.trust.certificate import Certificate, Keypair from sfa.trust.gid import create_uuid @@ -368,21 +368,18 @@ def update(api, record_dict): return 1 -# being PL specific it sounds right to expect a hrn+type (not a xrn) -def remove(api, hrn, type, origin_hrn=None): -# # convert xrn to hrn -# if type: -# hrn = urn_to_hrn(xrn)[0] -# else: -# hrn, type = urn_to_hrn(xrn) +# expecting an Xrn instance +def remove(api, xrn, origin_hrn=None): table = SfaTable() - filter = {'hrn': hrn} + filter = {'hrn': xrn.get_hrn()} + hrn=xrn.get_hrn() + type=xrn.get_type() if type and type not in ['all', '*']: filter['type'] = type + records = table.find(filter) - if not records: - raise RecordNotFound(hrn) + if not records: raise RecordNotFound(hrn) record = records[0] type = record['type']