X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Futil%2Fnamespace.py;h=93186c969a927a769aab8dacf6fe729a57c36674;hb=eababa96fb603cdd552bc03091813544b099befd;hp=fcc65ba4b6df301365e9137b4a039b1770868c0f;hpb=775fd2c579e39e634ce334caacf2049eb0ff251f;p=sfa.git diff --git a/sfa/util/namespace.py b/sfa/util/namespace.py index fcc65ba4..93186c96 100644 --- a/sfa/util/namespace.py +++ b/sfa/util/namespace.py @@ -20,21 +20,21 @@ def hrn_to_pl_slicename(hrn): # remove any escaped no alpah numeric characters #hrn = re.sub('\\\[^a-zA-Z0-9]', '', hrn) # remove any escaped '.' (i.e. '\.') - hrn.replace('\\.', '') + hrn = hrn.replace('\\.', '') parts = hrn.split(".") return parts[-2] + "_" + parts[-1] # assuming hrn is the hrn of an authority, return the plc authority name def hrn_to_pl_authname(hrn): # remove any escaped '.' (i.e. '\.') - hrn.replace('\\.', '') + hrn = hrn.replace('\\.', '') parts = hrn.split(".") return parts[-1] # assuming hrn is the hrn of an authority, return the plc login_base def hrn_to_pl_login_base(hrn): # remove any escaped '.' (i.e. '\.') - hrn.replace('\\.', '') + hrn = hrn.replace('\\.', '') return hrn_to_pl_authname(hrn) def hostname_to_hrn(auth_hrn, login_base, hostname): @@ -85,7 +85,7 @@ def urn_to_hrn(urn): # 2. escape '.' # '.' exists in protogeni object names and are not delimiters # 3. replace ':' with '.' # ':' is the urn hierarchy delimiter # 4. join list elements using '.' - hrn = '.'.join([part.replace('.', '\.').replace(':', '.') for part in hrn_parts if part]) + hrn = '.'.join([part.replace('.', '\\.').replace(':', '.') for part in hrn_parts if part]) return str(hrn), str(type)