diff --git a/examples/cluster.py b/examples/cluster.py index 8959868..078dca4 100755 --- a/examples/cluster.py +++ b/examples/cluster.py @@ -126,7 +126,7 @@ class ClusterCleanup( object ): def cleanup( cls ): "Clean up" info( '*** Cleaning up cluster\n' ) - for server, user in cls.serveruser.iteritems(): + for server, user in cls.serveruser.items(): if server == 'localhost': # Handled by mininet.clean.cleanup() continue diff --git a/examples/controlnet.py b/examples/controlnet.py index 9633089..e5cf765 100755 --- a/examples/controlnet.py +++ b/examples/controlnet.py @@ -49,7 +49,7 @@ class MininetFacade( object ): args: unnamed networks passed as arguments kwargs: named networks passed as arguments""" self.net = net - self.nets = [ net ] + list( args ) + kwargs.values() + self.nets = [ net ] + list( args ) + list( kwargs.values() ) self.nameToNet = kwargs self.nameToNet['net'] = net diff --git a/examples/multipoll.py b/examples/multipoll.py index 0b735ba..bb1c9d3 100755 --- a/examples/multipoll.py +++ b/examples/multipoll.py @@ -9,6 +9,7 @@ monitoring them from mininet.topo import SingleSwitchTopo from mininet.net import Mininet from mininet.log import info, setLogLevel +from mininet.util import decode from time import time from select import poll, POLLIN @@ -19,7 +20,7 @@ def monitorFiles( outfiles, seconds, timeoutms ): "Monitor set of files and return [(host, line)...]" devnull = open( '/dev/null', 'w' ) tails, fdToFile, fdToHost = {}, {}, {} - for h, outfile in outfiles.iteritems(): + for h, outfile in outfiles.items(): tail = Popen( [ 'tail', '-f', outfile ], stdout=PIPE, stderr=devnull ) fd = tail.stdout.fileno() @@ -40,7 +41,7 @@ def monitorFiles( outfiles, seconds, timeoutms ): host = fdToHost[ fd ] # Wait for a line of output line = f.readline().strip() - yield host, line + yield host, decode( line ) else: # If we timed out, return nothing yield None, ''