Commit 79a6fd21 authored by David Johnson's avatar David Johnson

Avoid bestEffort if specific shaping has been set.

parent 8f0d0a27
......@@ -439,12 +439,17 @@ clientvars.addVariable("AGGHOSTS"," ".join(sorted(agghosts.keys())))
clientvars.addVariable("AGGREGATES"," ".join(sorted(aggNodes.keys())))
def applyGenericNetworkSettings(lanlink):
def applyGenericNetworkSettings(lanlink,bandwidth=0,latency=0):
if params.trivialOk is True:
lanlink.trivial_ok = True
else:
lanlink.trivial_ok = False
if params.bestEffort is True:
if bandwidth > 0 or latency > 0:
if bandwidth > 0:
lanlink.bandwidth = bandwidth
if latency > 0:
lanlink.latency = latency
elif params.bestEffort is True:
lanlink.best_effort = True
else:
lanlink.best_effort = False
......@@ -487,12 +492,7 @@ for (mlist,name,shaping) in [
if not name:
name = "%s-lan" % (mlist[0])
lanlink = pg.LAN(name)
applyGenericNetworkSettings(lanlink)
if len(shaping) == 2:
if shaping[0]:
lanlink.bandwidth = int(shaping[0])
if shaping[1]:
lanlink.latency = int(shaping[1])
applyGenericNetworkSettings(lanlink,*shaping)
ifaces = map(lambda x: nodes[x].addInterface("if%d" % (nextIfaceNum(x))),
mlist)
map(lambda x: lanlink.addInterface(x),ifaces)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment