Use lxml.etree to parse VINI RSpec, validate against RelaxNG schema
[sfa.git] / sfa / managers / aggregate_manager_vini.py
index faeaebb..418f034 100644 (file)
@@ -1,11 +1,9 @@
 from sfa.util.faults import *
 from sfa.util.namespace import *
-from sfa.util.rspec import RSpec
 from sfa.server.registry import Registries
 from sfa.plc.nodes import *
 from sfa.plc.api import *
 from sfa.rspecs.aggregates.vini.utils import *
-from sfa.rspecs.aggregates.vini.rspec import *
 import sys
 
 """
@@ -131,7 +129,7 @@ def create_slice_vini_aggregate(api, hrn, nodes):
 
     return 1
 
-def get_rspec(api, xrn):
+def get_rspec(api, xrn, origin_hrn):
     hrn = urn_to_hrn(xrn)[0]
     topo = Topology(api)      
     if (hrn):
@@ -153,10 +151,8 @@ Hook called via 'sfi.py create'
 """
 def create_slice(api, xrn, xml):
     hrn = urn_to_hrn(xrn)[0]
-    rspec = RSpec(xml)
     topo = Topology(api)
-    
-    topo.nodeTopoFromRSpec(rspec)
+    topo.nodeTopoFromRSpec(xml)
 
     # Check request against current allocations
     topo.verifyNodeTopo(hrn, topo)
@@ -187,7 +183,7 @@ def fetch_context(slice_hrn, user_hrn, contexts):
     return base_context
 
 def main():
-    api = GeniAPI()
+    api = SfaAPI()
     #rspec = get_rspec(api, "plc.princeton.iias", None)
     #print rspec
     f = open(sys.argv[1])