From: Andy Bavier Date: Thu, 18 Feb 2010 19:17:26 +0000 (+0000) Subject: Change the type of all RSPecs to 'SFA' X-Git-Tag: sfa-0.9-11~86 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2504496c7349f87368685771a8d22a8e4cda6310;p=sfa.git Change the type of all RSPecs to 'SFA' --- diff --git a/sfa/managers/slice_manager_pl.py b/sfa/managers/slice_manager_pl.py index 2f23fe5d..b3854a0e 100644 --- a/sfa/managers/slice_manager_pl.py +++ b/sfa/managers/slice_manager_pl.py @@ -41,8 +41,10 @@ def delete_slice(api, xrn, origin_hrn=None): def create_slice(api, xrn, rspec, origin_hrn=None): hrn, type = urn_to_hrn(xrn) - # Validate the RSpec against PlanetLab's schema - schema = "/var/www/html/schemas/pl.rng" + # Validate the RSpec against PlanetLab's schema --disabled for now + # The schema used here needs to aggregate the PL and VINI schemas + # schema = "/var/www/html/schemas/pl.rng" + schema = None if schema: try: tree = etree.parse(StringIO(rspec)) @@ -217,12 +219,14 @@ def get_rspec(api, xrn=None, origin_hrn=None): raise InvalidRSpec(message) root = tree.getroot() - if root.get("type") in ["Planetlab", "VINI"]: + if root.get("type") in ["SFA"]: if rspec == None: rspec = root else: for network in root.iterfind("./network"): rspec.append(deepcopy(network)) + for request in root.iterfind("./request"): + rspec.append(deepcopy(request)) return etree.tostring(rspec, xml_declaration=True, pretty_print=True) diff --git a/sfa/managers/vini/vini_network.py b/sfa/managers/vini/vini_network.py index bbc051e6..26d8a338 100644 --- a/sfa/managers/vini/vini_network.py +++ b/sfa/managers/vini/vini_network.py @@ -240,7 +240,7 @@ class Link: class ViniNetwork(Network): - def __init__(self, api, type = "VINI"): + def __init__(self, api, type = "SFA"): Network.__init__(self, api, type) self.sitelinks = [] self.nodelinks = [] diff --git a/sfa/plc/network.py b/sfa/plc/network.py index cf220299..955036c5 100644 --- a/sfa/plc/network.py +++ b/sfa/plc/network.py @@ -295,7 +295,7 @@ A Network is a compound object consisting of: * 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)