updated calls to accept/support urn format where necessary
authorTony Mack <tmack@cs.princeton.edu>
Mon, 18 Jan 2010 17:36:30 +0000 (17:36 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 18 Jan 2010 17:36:30 +0000 (17:36 +0000)
sfa/managers/aggregate_manager_eucalyptus.py
sfa/managers/aggregate_manager_max.py
sfa/managers/aggregate_manager_openflow.py
sfa/managers/aggregate_manager_vini.py

index fa0f8b2..dd15377 100644 (file)
@@ -222,8 +222,9 @@ class ZoneResultParser(object):
 
         return clusterList
 
-def get_rspec(api, hrn, origin_hrn):
+def get_rspec(api, xrn, origin_hrn):
     global cloud
+    hrn = urn_to_hrn(xrn)[0]
     conn = getEucaConnection()
 
     if not conn:
@@ -256,7 +257,8 @@ def get_rspec(api, hrn, origin_hrn):
 """
 Hook called via 'sfi.py create'
 """
-def create_slice(api, hrn, xml):
+def create_slice(api, xrn, xml):
+    hrn = urn_to_hrn(xrn)[0]
     return True
 
 def main():
index 5c12875..d341034 100644 (file)
@@ -248,7 +248,8 @@ def create_slice_max_aggregate(api, hrn, nodes):
     return 1
 
 
-def get_rspec(api, hrn):
+def get_rspec(api, xrn):
+    hrn = urn_to_hrn(xrn)[0]
     # Eg. config line:
     # plc.princeton.sapan vlan23,vlan45
 
@@ -261,8 +262,9 @@ def get_rspec(api, hrn):
     return (ret_rspec)
 
 
-def create_slice(api, hrn, rspec_xml):
+def create_slice(api, xrn, rspec_xml):
     global topology
+    hrn = urn_to_hrn(xrn)[0]
     topology = get_interface_map()
 
     # Check if everything in rspec is either allocated by hrn
index a745b6e..d2507eb 100755 (executable)
@@ -89,23 +89,28 @@ def msg_aggrMgr(cred, hrn, msg_id):
         print "IO error"
     return 0
 
-def start_slice(cred, hrn):
+def start_slice(cred, xrn):
+    hrn = urn_to_hrn(xrn)[0]
     if DEBUG: print "Received start_slice call"
     return msg_aggrMgr(SFA_START_SLICE)
 
-def stop_slice(cred, hrn):
+def stop_slice(cred, xrn):
+    hrn = urn_to_hrn(xrn)[0]
     if DEBUG: print "Received stop_slice call"
     return msg_aggrMgr(SFA_STOP_SLICE)
 
-def delete_slice(cred, hrn):
+def delete_slice(cred, xrn):
+    hrn = urn_to_hrn(xrn)[0]
     if DEBUG: print "Received delete_slice call"
     return msg_aggrMgr(SFA_DELETE_SLICE)
 
-def reset_slices(cred, hrn):
+def reset_slices(cred, xrn):
+    hrn = urn_to_hrn(xrn)[0]
     if DEBUG: print "Received reset_slices call"
     return msg_aggrMgr(SFA_RESET_SLICES)
 
-def create_slice(cred, hrn, rspec):
+def create_slice(cred, xrn, rspec):
+    hrn = urn_to_hrn(xrn)[0]
     if DEBUG: print "Received create_slice call"
     slice_id = generate_slide_id(cred, hrn)
 
@@ -126,7 +131,8 @@ def create_slice(cred, hrn, rspec):
         print "IO error"
     return 0
 
-def get_rspec(cred, hrn=None):
+def get_rspec(cred, xrn=None):
+    hrn = urn_to_hrn(xrn)[0]
     if DEBUG: print "Received get_rspec call"
     slice_id = generate_slide_id(cred, hrn)
 
index e8f879c..b4d0984 100644 (file)
@@ -132,7 +132,8 @@ def create_slice_vini_aggregate(api, hrn, nodes):
 
     return 1
 
-def get_rspec(api, hrn):
+def get_rspec(api, xrn):
+    hrn = urn_to_hrn(xrn)[0]
     topo = Topology(api)      
     if (hrn):
         slicename = hrn_to_pl_slicename(hrn)
@@ -151,7 +152,8 @@ def get_rspec(api, hrn):
 """
 Hook called via 'sfi.py create'
 """
-def create_slice(api, hrn, xml):
+def create_slice(api, xrn, xml):
+    hrn = urn_to_hrn(xrn)[0]
     ### Check the whitelist
     ### It consists of lines of the form: <slice hrn> <bw>
     whitelist = {}