from sfa.util.rspec import RSpec
import sys
import pdb
-from sfa.util.misc import *
+from sfa.util.namespace import *
from sfa.util.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
from sfa.util.storage import *
from sfa.util.policy import Policy
-from sfa.util.debug import log
from sfa.server.aggregate import Aggregates
from sfa.server.registry import Registries
from sfa.util.faults import *
topology = {}
-class GeniOutOfResource(GeniFault):
+class SfaOutOfResource(SfaFault):
def __init__(self, interface):
faultString = "Interface " + interface + " not available"
- GeniFault.__init__(self, 100, faultString, '')
+ SfaFault.__init__(self, 100, faultString, '')
-class GeniNoPairRSpec(GeniFault):
+class SfaNoPairRSpec(SfaFault):
def __init__(self, interface, interface2):
faultString = "Interface " + interface + " should be paired with " + interface2
- GeniFault.__init__(self, 100, faultString, '')
+ SfaFault.__init__(self, 100, faultString, '')
# Returns a mapping from interfaces to the nodes they lie on and their peer interfaces
# i -> node,i_peer
# Taken from slices.py
def create_slice_max_aggregate(api, hrn, nodes):
- # Get the slice record from geni
+ # Get the slice record
global topology
topology = get_interface_map()
slice = {}
return 1
-def get_rspec(api, hrn):
+def get_rspec(api, creds, options):
+ # get slice's hrn from options
+ xrn = options.get('geni_slice_urn', None)
+ hrn, type = urn_to_hrn(xrn)
# Eg. config line:
# plc.princeton.sapan vlan23,vlan45
return (ret_rspec)
-def create_slice(api, hrn, rspec_xml):
+def create_slice(api, xrn, creds, rspec_xml, users):
global topology
+ hrn = urn_to_hrn(xrn)[0]
topology = get_interface_map()
# Check if everything in rspec is either allocated by hrn
for a in requested_interfaces:
if (a not in current_hrn_interfaces and a in current_interfaces):
- raise GeniOutOfResource(a)
+ raise SfaOutOfResource(a)
if (topology[a][1] not in requested_interfaces):
- raise GeniNoPairRSpec(a,topology[a][1])
+ raise SfaNoPairRSpec(a,topology[a][1])
# Request OK
# Allocations to delete