- # XX rspec is expected to be xml, not None.
- # call the default sfa.plc.nodes.get_rspec() methods
- # until things are complete here
- nodes = Nodes(api)
- rspec = nodes.get_rspec(hrn)
-
- # Convert HRN to slice name
- # Get SliceTags for the slice
-
- # Construct LinkSpecs from the topo_rspec SliceTags
- # The first field is the NodeId of the remote node.
- # So the endpoints are the SliceTag node and the remote node.
-
- # How to:
- # - avoid duplicates?
- # - verify both ends of the link?
- pass
- else:
- # Return canned response for now...
- r = Rspec()
- r.parseFile(SFA_VINI_DEFAULT_RSPEC)
- rspec = r.toxml()
+ slicename = hrn_to_pl_slicename(hrn)
+ slice = get_slice(api, slicename)
+ if slice:
+ slice.hrn = hrn
+ topo.nodeTopoFromSliceTags(slice)
+ else:
+ # call the default sfa.plc.nodes.get_rspec() method
+ return Nodes(api).get_rspec(hrn)
+
+ return topo.toxml(hrn)