From cfb6bf95a367d4984d101bc3a6c98bab96374db1 Mon Sep 17 00:00:00 2001 From: Brian O'Connor <bocon13@gmail.com> Date: Mon, 9 Sep 2013 19:22:41 -0700 Subject: [PATCH] adding commandline args to UserSwitch in controlnet, examples of partial --- examples/controlnet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/controlnet.py b/examples/controlnet.py index f9454c79..d5a8781a 100755 --- a/examples/controlnet.py +++ b/examples/controlnet.py @@ -14,6 +14,8 @@ control and data networks from a single CLI. """ +from functools import partial + from mininet.net import Mininet from mininet.node import Controller, UserSwitch from mininet.cli import CLI @@ -124,7 +126,8 @@ def run(): info( '* Creating Data Network\n' ) topo = TreeTopo( depth=2, fanout=2 ) # UserSwitch so we can easily test failover - net = Mininet( topo=topo, switch=UserSwitch, controller=None ) + sw = partial( UserSwitch, opts='--inactivity-probe=1 --max-backoff=1' ) + net = Mininet( topo=topo, switch=sw, controller=None ) info( '* Adding Controllers to Data Network\n' ) for host in cnet.hosts: if isinstance(host, Controller): -- GitLab