File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,14 +148,14 @@ def do_dump( self, args ):
148148 output ( '%s\n ' % node )
149149
150150 def do_link ( self , args ):
151- "Bring a link up or down."
151+ "Bring link(s) between two nodes up or down."
152152 args = args .split ()
153153 if len (args ) != 3 :
154- error ( 'invalid number of args: link [up down] end1 end2 \n ' )
155- elif args [ 0 ] not in [ 'up' , 'down' ]:
156- error ( 'invalid type: link [up down] end1 end2 \n ' )
154+ error ( 'invalid number of args: link end1 end2 [up down]\n ' )
155+ elif args [ 2 ] not in [ 'up' , 'down' ]:
156+ error ( 'invalid type: link end1 end2 [up down]\n ' )
157157 else :
158- self .mn .link ( * args )
158+ self .mn .configLinkStatus ( * args )
159159
160160 def do_pause ( self , args ):
161161 "Temporarily bring a node down."
Original file line number Diff line number Diff line change @@ -511,11 +511,11 @@ def iperfUdp( self, udpBw='10M' ):
511511 "Run iperf UDP test."
512512 return self .iperf ( l4Type = 'UDP' , udpBw = udpBw )
513513
514- def link ( self , status , src , dst ):
515- """Change link status.
516- status: string {up, down}
517- src: string
518- dst : string"""
514+ def configLinkStatus ( self , src , dst , status ):
515+ """Change status of src <-> dst links .
516+ src: node name
517+ dst: node name
518+ status : string {up, down} """
519519 if src not in self .nameToNode :
520520 error ( 'src not in network: %s\n ' % src )
521521 elif dst not in self .nameToNode :
You can’t perform that action at this time.
0 commit comments