self.network = network
self.id = slice['slice_id']
self.name = slice['name']
+ self.peer_id = slice['peer_id']
self.node_ids = set(slice['node_ids'])
self.slice_tag_ids = slice['slice_tag_ids']
* a dictionary mapping interface IDs to Iface objects
"""
class Network:
- def __init__(self, api, type = "PlanetLab"):
+ def __init__(self, api, type = "SFA"):
self.api = api
self.type = type
self.sites = self.get_sites(api)
message = str(sys.exc_info()[1])
raise InvalidRSpec(message)
+ # Filter out stuff that's not for us
+ rspec = tree.getroot()
+ for network in rspec.iterfind("./network"):
+ if network.get("name") != self.api.hrn:
+ rspec.remove(network)
+ for request in rspec.iterfind("./request"):
+ if request.get("name") != self.api.hrn:
+ rspec.remove(request)
+
if schema:
# Validate the incoming request against the RelaxNG schema
relaxng_doc = etree.parse(schema)
message = "%s (line %s)" % (error.message, error.line)
raise InvalidRSpec(message)
- rspec = tree.getroot()
self.rspec = rspec
- defaults = rspec.find("./network/sliver_defaults")
+ defaults = rspec.find(".//sliver_defaults")
self.__process_attributes(defaults)
# Find slivers under node elements