#!/usr/bin/python
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
import sys
import pdb
from sfa.util.misc import *
faultString = "Interface " + interface + " not available"
GeniFault.__init__(self, 100, faultString, '')
-class GeniNoPairRspec(GeniFault):
+class GeniNoPairRSpec(GeniFault):
def __init__(self, interface, interface2):
faultString = "Interface " + interface + " should be paired with " + interface2
GeniFault.__init__(self, 100, faultString, '')
# i -> node,i_peer
def get_interface_map():
- r = Rspec()
+ r = RSpec()
r.parseFile(SFA_MAX_DEFAULT_RSPEC)
rspec = r.toDict()
capacity = rspec['rspec']['capacity']
# Check if everything in rspec is either allocated by hrn
# or not allocated at all.
- r = Rspec()
+ r = RSpec()
r.parseString(rspec_xml)
rspec = r.toDict()
if (a not in current_hrn_interfaces and a in current_interfaces):
raise GeniOutOfResource(a)
if (topology[a][1] not in requested_interfaces):
- raise GeniNoPairRspec(a,topology[a][1])
+ raise GeniNoPairRSpec(a,topology[a][1])
# Request OK
# Allocations to delete
for l in ifspecs:
ifs.extend([(l['name'].replace('tns:',''),l['ip'])])
except KeyError:
- # Bad Rspec
+ # Bad RSpec
pass
return ifs
def main():
t = get_interface_map()
- r = Rspec()
+ r = RSpec()
rspec_xml = open(sys.argv[1]).read()
#get_rspec(None,'foo')
create_slice(None, "plc.princeton.sap0", rspec_xml)