def __init__(self, driver):
self.driver = driver
- ##Used in SFACE?
- #def get_slivers(self, xrn, node=None):
- #hrn, hrn_type = urn_to_hrn(xrn)
-
- #slice_name = hrn_to_pl_slicename(hrn)
- ## XX Should we just call PLCAPI.GetSliceTicket(slice_name) instead
- ## of doing all of this?
- ##return self.api.driver.GetSliceTicket(self.auth, slice_name)
-
-
-
- #sfa_slice = self.driver.GetSlices(slice_filter = slice_name, \
- # slice_filter_type = 'slice_hrn')
-
-
- ## Get user information
- ##TODO
- #alchemy_person = dbsession.query(RegRecord).filter_by(record_id = \
- #sfa_slice['record_id_user']).first()
-
- #slivers = []
- #sliver_attributes = []
-
- #if sfa_slice['oar_job_id'] is not -1:
- #nodes_all = self.driver.GetNodes({'hostname': \
- #sfa_slice['node_ids']},
- #['node_id', 'hostname','site','boot_state'])
- #nodeall_byhostname = dict([(n['hostname'], n) for n in nodes_all])
- #nodes = sfa_slice['node_ids']
-
- #for node in nodes:
- ##for sliver_attribute in filter(lambda a: a['node_id'] == \
- #node['node_id'], slice_tags):
- #sliver_attribute['tagname'] = 'slab-tag'
- #sliver_attribute['value'] = 'slab-value'
- #sliver_attributes.append(sliver_attribute['tagname'])
- #attributes.append({'tagname': sliver_attribute['tagname'],
- #'value': sliver_attribute['value']})
-
- ## set nodegroup slice attributes
- #for slice_tag in filter(lambda a: a['nodegroup_id'] \
- #in node['nodegroup_ids'], slice_tags):
- ## Do not set any nodegroup slice attributes for
- ## which there is at least one sliver attribute
- ## already set.
- #if slice_tag not in slice_tags:
- #attributes.append({'tagname': slice_tag['tagname'],
- #'value': slice_tag['value']})
-
- #for slice_tag in filter(lambda a: a['node_id'] is None, \
- #slice_tags):
- ## Do not set any global slice attributes for
- ## which there is at least one sliver attribute
- ## already set.
- #if slice_tag['tagname'] not in sliver_attributes:
- #attributes.append({'tagname': slice_tag['tagname'],
- #'value': slice_tag['value']})
-
- ## XXX Sanity check; though technically this should
- ## be a system invariant
- ## checked with an assertion
- #if sfa_slice['expires'] > MAXINT: sfa_slice['expires']= MAXINT
-
- #slivers.append({
- #'hrn': hrn,
- #'name': sfa_slice['name'],
- #'slice_id': sfa_slice['slice_id'],
- #'instantiation': sfa_slice['instantiation'],
- #'expires': sfa_slice['expires'],
- #'keys': keys,
- #'attributes': attributes
- #})
-
- #return slivers
-
-
-
-
-
- #return slivers
+
def get_peer(self, xrn):
hrn, hrn_type = urn_to_hrn(xrn)
#Does this slice belong to a local site or a peer senslab site?