Change the type of all RSPecs to 'SFA'
authorAndy Bavier <acb@cs.princeton.edu>
Thu, 18 Feb 2010 19:17:26 +0000 (19:17 +0000)
committerAndy Bavier <acb@cs.princeton.edu>
Thu, 18 Feb 2010 19:17:26 +0000 (19:17 +0000)
sfa/managers/slice_manager_pl.py
sfa/managers/vini/vini_network.py
sfa/plc/network.py

index 2f23fe5..b3854a0 100644 (file)
@@ -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)
 
index bbc051e..26d8a33 100644 (file)
@@ -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 = []
index cf22029..955036c 100644 (file)
@@ -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)