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
/
vini
/
utils.py
diff --git
a/sfa/rspecs/aggregates/vini/utils.py
b/sfa/rspecs/aggregates/vini/utils.py
index
e67e041
..
ea36aad
100644
(file)
--- a/
sfa/rspecs/aggregates/vini/utils.py
+++ b/
sfa/rspecs/aggregates/vini/utils.py
@@
-7,62
+7,62
@@
default_topo_xml = """
<LinkSpec>
<endpoint>i2atla1</endpoint>
<endpoint>i2chic1</endpoint>
<LinkSpec>
<endpoint>i2atla1</endpoint>
<endpoint>i2chic1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2atla1</endpoint>
<endpoint>i2hous1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2atla1</endpoint>
<endpoint>i2hous1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2atla1</endpoint>
<endpoint>i2wash1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2atla1</endpoint>
<endpoint>i2wash1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2chic1</endpoint>
<endpoint>i2kans1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2chic1</endpoint>
<endpoint>i2kans1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2chic1</endpoint>
<endpoint>i2wash1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2chic1</endpoint>
<endpoint>i2wash1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2hous1</endpoint>
<endpoint>i2kans1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2hous1</endpoint>
<endpoint>i2kans1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2hous1</endpoint>
<endpoint>i2losa1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2hous1</endpoint>
<endpoint>i2losa1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2kans1</endpoint>
<endpoint>i2salt1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2kans1</endpoint>
<endpoint>i2salt1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2losa1</endpoint>
<endpoint>i2salt1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2losa1</endpoint>
<endpoint>i2salt1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2losa1</endpoint>
<endpoint>i2seat1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2losa1</endpoint>
<endpoint>i2seat1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2newy1</endpoint>
<endpoint>i2wash1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2newy1</endpoint>
<endpoint>i2wash1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>
<LinkSpec>
<endpoint>i2salt1</endpoint>
<endpoint>i2seat1</endpoint>
</LinkSpec>
<LinkSpec>
<endpoint>i2salt1</endpoint>
<endpoint>i2seat1</endpoint>
- <
bw>1Mbit</bw
>
+ <
kbps>1000</kbps
>
</LinkSpec>"""
# Taken from bwlimit.py
</LinkSpec>"""
# Taken from bwlimit.py
@@
-481,7
+481,7
@@
class Topology:
return link
return None
return link
return None
- def nodeTopoFromR
s
pec(self, rspec):
+ def nodeTopoFromR
S
pec(self, rspec):
if self.nodelinks:
raise Error("virtual topology already present")
if self.nodelinks:
raise Error("virtual topology already present")
@@
-494,7
+494,7
@@
class Topology:
for l in linkspecs:
n1 = nodedict[l['endpoint'][0]]
n2 = nodedict[l['endpoint'][1]]
for l in linkspecs:
n1 = nodedict[l['endpoint'][0]]
n2 = nodedict[l['endpoint'][1]]
- bps =
get_tc_rate(l['bw'][0])
+ bps =
int(l['kbps'][0]) * 1000
self.nodelinks.append(Link(n1, n2, bps))
def nodeTopoFromSliceTags(self, slice):
self.nodelinks.append(Link(n1, n2, bps))
def nodeTopoFromSliceTags(self, slice):
@@
-542,7
+542,7
@@
class Topology:
maxbps = get_tc_rate(maxbw)
for link in self.nodelinks:
if link.bps <= 0:
maxbps = get_tc_rate(maxbw)
for link in self.nodelinks:
if link.bps <= 0:
- raise
Geni
InvalidArgument(bw, "BW")
+ raise
Sfa
InvalidArgument(bw, "BW")
if link.bps > maxbps:
raise PermissionError(" %s requested %s but max BW is %s" %
(hrn, format_tc_rate(link.bps), maxbw))
if link.bps > maxbps:
raise PermissionError(" %s requested %s but max BW is %s" %
(hrn, format_tc_rate(link.bps), maxbw))
@@
-560,12
+560,12
@@
class Topology:
"""
def toxml(self, hrn = None):
xml = """<?xml version="1.0"?>
"""
def toxml(self, hrn = None):
xml = """<?xml version="1.0"?>
-<R
spec xmlns="http://www.planet-lab.org/sfa/rspec/"
name="vini">
+<R
Spec
name="vini">
<Capacity>
<NetSpec name="physical_topology">"""
for site in self.getSites():
<Capacity>
<NetSpec name="physical_topology">"""
for site in self.getSites():
- if not (site.public and site.enabled):
+ if not (site.public and site.enabled
and site.node_ids
):
continue
xml += """
continue
xml += """
@@
-578,8
+578,8
@@
class Topology:
xml += """
<NodeSpec name="%s">
<hostname>%s</hostname>
xml += """
<NodeSpec name="%s">
<hostname>%s</hostname>
- <
bw>%s</bw
>
- </NodeSpec>""" % (node.tag, node.hostname,
format_tc_rate(node.bps
))
+ <
kbps>%s</kbps
>
+ </NodeSpec>""" % (node.tag, node.hostname,
int(node.bps/1000
))
xml += """
</SiteSpec>"""
xml += """
</SiteSpec>"""
@@
-588,8
+588,8
@@
class Topology:
<SiteLinkSpec>
<endpoint>%s</endpoint>
<endpoint>%s</endpoint>
<SiteLinkSpec>
<endpoint>%s</endpoint>
<endpoint>%s</endpoint>
- <
bw>%s</bw
>
- </SiteLinkSpec>""" % (link.end1.name, link.end2.name,
format_tc_rate(link.bps
))
+ <
kbps>%s</kbps
>
+ </SiteLinkSpec>""" % (link.end1.name, link.end2.name,
int(link.bps/1000
))
if hrn:
if hrn:
@@
-608,15
+608,15
@@
class Topology:
<LinkSpec>
<endpoint>%s</endpoint>
<endpoint>%s</endpoint>
<LinkSpec>
<endpoint>%s</endpoint>
<endpoint>%s</endpoint>
- <
bw>%s</bw
>
- </LinkSpec>""" % (link.end1.tag, link.end2.tag,
format_tc_rate(link.bps
))
+ <
kbps>%s</kbps
>
+ </LinkSpec>""" % (link.end1.tag, link.end2.tag,
int(link.bps/1000
))
else:
xml += default_topo_xml
xml += """
</NetSpec>
</Request>
else:
xml += default_topo_xml
xml += """
</NetSpec>
</Request>
-</R
s
pec>"""
+</R
S
pec>"""
# Remove all leading whitespace and newlines
lines = xml.split("\n")
# Remove all leading whitespace and newlines
lines = xml.split("\n")