From: Tony Mack Date: Thu, 20 Oct 2011 16:08:19 +0000 (-0400) Subject: added support for interfaces X-Git-Tag: sfa-1.1-1~84 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f3121bd4ab559117a3c62253e955a3695837b8c6;p=sfa.git added support for interfaces --- diff --git a/sfa/util/plxrn.py b/sfa/util/plxrn.py index dacdd514..5976f3ec 100644 --- a/sfa/util/plxrn.py +++ b/sfa/util/plxrn.py @@ -26,7 +26,7 @@ class PlXrn (Xrn): def site_hrn (auth, login_base): return '.'.join([auth,login_base]) - def __init__ (self, auth=None, hostname=None, slicename=None, email=None, **kwargs): + def __init__ (self, auth=None, hostname=None, slicename=None, email=None, interface=None, **kwargs): #def hostname_to_hrn(auth_hrn, login_base, hostname): if hostname is not None: self.type='node' @@ -48,6 +48,10 @@ class PlXrn (Xrn): # keep only the part before '@' and replace special chars into _ self.hrn='.'.join([auth,email.split('@')[0].replace(".", "_").replace("+", "_")]) self.hrn_to_urn() + elif interface is not None: + self.type = 'interface' + self.hrn = auth + '.' + interface + self.hrn_to_urn() else: Xrn.__init__ (self,**kwargs)