git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed another bunch of references to geni
[sfa.git]
/
sfa
/
rspecs
/
aggregates
/
rspec_manager_max.py
diff --git
a/sfa/rspecs/aggregates/rspec_manager_max.py
b/sfa/rspecs/aggregates/rspec_manager_max.py
index
2de9181
..
c6504b9
100644
(file)
--- a/
sfa/rspecs/aggregates/rspec_manager_max.py
+++ b/
sfa/rspecs/aggregates/rspec_manager_max.py
@@
-1,9
+1,9
@@
#!/usr/bin/python
#!/usr/bin/python
-from sfa.util.rspec import R
s
pec
+from sfa.util.rspec import R
S
pec
import sys
import pdb
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.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
@@
-22,21
+22,21
@@
SFA_MAX_CANNED_RSPEC = '/etc/sfa/max_physical_canned.xml'
topology = {}
topology = {}
-class
GeniOutOfResource(Geni
Fault):
+class
SfaOutOfResource(Sfa
Fault):
def __init__(self, interface):
faultString = "Interface " + interface + " not available"
def __init__(self, interface):
faultString = "Interface " + interface + " not available"
-
Geni
Fault.__init__(self, 100, faultString, '')
+
Sfa
Fault.__init__(self, 100, faultString, '')
-class
GeniNoPairRspec(Geni
Fault):
+class
SfaNoPairRSpec(Sfa
Fault):
def __init__(self, interface, interface2):
faultString = "Interface " + interface + " should be paired with " + interface2
def __init__(self, interface, interface2):
faultString = "Interface " + interface + " should be paired with " + interface2
-
Geni
Fault.__init__(self, 100, faultString, '')
+
Sfa
Fault.__init__(self, 100, faultString, '')
# Returns a mapping from interfaces to the nodes they lie on and their peer interfaces
# i -> node,i_peer
def get_interface_map():
# Returns a mapping from interfaces to the nodes they lie on and their peer interfaces
# i -> node,i_peer
def get_interface_map():
- r = R
s
pec()
+ r = R
S
pec()
r.parseFile(SFA_MAX_DEFAULT_RSPEC)
rspec = r.toDict()
capacity = rspec['rspec']['capacity']
r.parseFile(SFA_MAX_DEFAULT_RSPEC)
rspec = r.toDict()
capacity = rspec['rspec']['capacity']
@@
-140,7
+140,7
@@
def alloc_nodes(api,hrn, requested_ifs):
# Taken from slices.py
def create_slice_max_aggregate(api, hrn, nodes):
# Taken from slices.py
def create_slice_max_aggregate(api, hrn, nodes):
- # Get the slice record from
geni
+ # Get the slice record from
SFA
global topology
topology = get_interface_map()
slice = {}
global topology
topology = get_interface_map()
slice = {}
@@
-267,7
+267,7
@@
def create_slice(api, hrn, rspec_xml):
# Check if everything in rspec is either allocated by hrn
# or not allocated at all.
# Check if everything in rspec is either allocated by hrn
# or not allocated at all.
- r = R
s
pec()
+ r = R
S
pec()
r.parseString(rspec_xml)
rspec = r.toDict()
r.parseString(rspec_xml)
rspec = r.toDict()
@@
-288,9
+288,9
@@
def create_slice(api, hrn, rspec_xml):
for a in requested_interfaces:
if (a not in current_hrn_interfaces and a in current_interfaces):
for a in requested_interfaces:
if (a not in current_hrn_interfaces and a in current_interfaces):
- raise
Geni
OutOfResource(a)
+ raise
Sfa
OutOfResource(a)
if (topology[a][1] not in requested_interfaces):
if (topology[a][1] not in requested_interfaces):
- raise
GeniNoPairRs
pec(a,topology[a][1])
+ raise
SfaNoPairRS
pec(a,topology[a][1])
# Request OK
# Allocations to delete
# Request OK
# Allocations to delete
@@
-316,13
+316,13
@@
def rspec_to_allocations(rspec):
for l in ifspecs:
ifs.extend([(l['name'].replace('tns:',''),l['ip'])])
except KeyError:
for l in ifspecs:
ifs.extend([(l['name'].replace('tns:',''),l['ip'])])
except KeyError:
- # Bad R
s
pec
+ # Bad R
S
pec
pass
return ifs
def main():
t = get_interface_map()
pass
return ifs
def main():
t = get_interface_map()
- r = R
s
pec()
+ r = R
S
pec()
rspec_xml = open(sys.argv[1]).read()
#get_rspec(None,'foo')
create_slice(None, "plc.princeton.sap0", rspec_xml)
rspec_xml = open(sys.argv[1]).read()
#get_rspec(None,'foo')
create_slice(None, "plc.princeton.sap0", rspec_xml)