git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added support for urn name format. urn is the default name format used over the wire
[sfa.git]
/
sfa
/
plc
/
slices.py
diff --git
a/sfa/plc/slices.py
b/sfa/plc/slices.py
index
622c0e9
..
18c7584
100644
(file)
--- a/
sfa/plc/slices.py
+++ b/
sfa/plc/slices.py
@@
-7,12
+7,12
@@
import traceback
import sys
from types import StringTypes
import sys
from types import StringTypes
-from sfa.util.
misc
import *
+from sfa.util.
namespace
import *
from sfa.util.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
from sfa.util.storage import *
from sfa.util.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
from sfa.util.storage import *
-from sfa.util.record import
Geni
Record
+from sfa.util.record import
Sfa
Record
from sfa.util.policy import Policy
from sfa.util.prefixTree import prefixTree
from sfa.util.debug import log
from sfa.util.policy import Policy
from sfa.util.prefixTree import prefixTree
from sfa.util.debug import log
@@
-38,7
+38,8
@@
class Slices(SimpleStorage):
self.load()
self.origin_hrn = origin_hrn
self.load()
self.origin_hrn = origin_hrn
- def get_slivers(self, hrn, node=None):
+ def get_slivers(self, xrn, node=None):
+ hrn, type = urn_to_hrn(xrn)
slice_name = hrn_to_pl_slicename(hrn)
# XX Should we just call PLCAPI.GetSliceTicket(slice_name) instead
slice_name = hrn_to_pl_slicename(hrn)
# XX Should we just call PLCAPI.GetSliceTicket(slice_name) instead
@@
-142,7
+143,8
@@
class Slices(SimpleStorage):
return slivers
return slivers
- def get_peer(self, hrn):
+ def get_peer(self, xrn):
+ hrn, type = urn_to_hrn(xrn)
# Becaues of myplc federation, we first need to determine if this
# slice belongs to out local plc or a myplc peer. We will assume it
# is a local site, unless we find out otherwise
# Becaues of myplc federation, we first need to determine if this
# slice belongs to out local plc or a myplc peer. We will assume it
# is a local site, unless we find out otherwise
@@
-163,7
+165,9
@@
class Slices(SimpleStorage):
return peer
return peer
- def get_sfa_peer(self, hrn):
+ def get_sfa_peer(self, xrn):
+ hrn, type = urn_to_hrn(xrn)
+
# return the authority for this hrn or None if we are the authority
sfa_peer = None
slice_authority = get_authority(hrn)
# return the authority for this hrn or None if we are the authority
sfa_peer = None
slice_authority = get_authority(hrn)
@@
-249,7
+253,8
@@
class Slices(SimpleStorage):
def verify_site(self, registry, credential, slice_hrn, peer, sfa_peer):
authority = get_authority(slice_hrn)
def verify_site(self, registry, credential, slice_hrn, peer, sfa_peer):
authority = get_authority(slice_hrn)
- site_records = registry.resolve(credential, authority)
+ authority_urn = hrn_to_urn(authority, 'authority')
+ site_records = registry.resolve(credential, authority_urn)
site = {}
for site_record in site_records:
site = {}
for site_record in site_records:
@@
-401,8
+406,8
@@
class Slices(SimpleStorage):
except: pass
except: pass
- def create_slice_aggregate(self,
h
rn, rspec):
-
+ def create_slice_aggregate(self,
x
rn, rspec):
+ hrn, type = urn_to_hrn(xrn)
# Determine if this is a peer slice
peer = self.get_peer(hrn)
sfa_peer = self.get_sfa_peer(hrn)
# Determine if this is a peer slice
peer = self.get_peer(hrn)
sfa_peer = self.get_sfa_peer(hrn)