Skip to content
Snippets Groups Projects
Commit 9da63d4e authored by Brandon Heller's avatar Brandon Heller
Browse files

Add dpctl command, which runs on all switches

parent 0a9358c9
No related branches found
No related tags found
No related merge requests found
......@@ -272,6 +272,20 @@ def do_source( self, line ):
error( 'error reading file %s\n' % args[ 0 ] )
self.inputFile = None
def do_dpctl( self, line ):
"Run dpctl command on all switches."
args = line.split()
if len(args) == 0:
error( 'usage: dpctl command [arg1] [arg2] ...\n' )
return
if not self.mn.listenPort:
error( "can't run dpctl w/no passive listening port\n")
return
for sw in self.mn.switches:
output( '*** ' + sw.name + ' ' + ('-' * 72) + '\n' )
output( sw.cmd( 'dpctl ' + ' '.join(args) +
' tcp:127.0.0.1:%i' % sw.listenPort ) )
def default( self, line ):
"""Called on an input line when the command prefix is not recognized.
Overridden to run shell commands when a node is the first CLI argument.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment