git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
30e2e0f
)
added 'auth' param to __init__
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 29 Jun 2012 17:59:13 +0000
(13:59 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 29 Jun 2012 17:59:13 +0000
(13:59 -0400)
sfa/openstack/osxrn.py
patch
|
blob
|
history
diff --git
a/sfa/openstack/osxrn.py
b/sfa/openstack/osxrn.py
index
ad82f22
..
830ee9a
100644
(file)
--- a/
sfa/openstack/osxrn.py
+++ b/
sfa/openstack/osxrn.py
@@
-3,16
+3,22
@@
from sfa.util.xrn import Xrn
from sfa.util.config import Config
def hrn_to_os_slicename(hrn):
from sfa.util.config import Config
def hrn_to_os_slicename(hrn):
- return OSXrn(xrn=hrn, type='slice').get_slicename()
+ return OSXrn(xrn=hrn, type='slice').get_slicename()
+
+def cleanup_name(name):
+ return name.replace(".", "_").replace("+", "_")
class OSXrn(Xrn):
class OSXrn(Xrn):
- def __init__(self, name=None, type=None, **kwds):
+ def __init__(self, name=None, type=None,
auth=None,
**kwds):
config = Config()
if name is not None:
self.type = type
config = Config()
if name is not None:
self.type = type
- self.hrn = config.SFA_INTERFACE_HRN + "." + name
+ if auth is not None:
+ self.hrn='.'.join([auth, cleanup_name(name)])
+ else:
+ self.hrn = config.SFA_INTERFACE_HRN + "." + cleanup_name(name)
self.hrn_to_urn()
else:
Xrn.__init__(self, **kwds)
self.hrn_to_urn()
else:
Xrn.__init__(self, **kwds)