Send a command, wait for output, and return it. cmd: string
( self, *args, **kwargs )
| 377 | return output |
| 378 | |
| 379 | def cmd( self, *args, **kwargs ): |
| 380 | """Send a command, wait for output, and return it. |
| 381 | cmd: string""" |
| 382 | verbose = kwargs.get( 'verbose', False ) |
| 383 | log = info if verbose else debug |
| 384 | log( '*** %s : %s\n' % ( self.name, args ) ) |
| 385 | if self.shell: |
| 386 | self.sendCmd( *args, **kwargs ) |
| 387 | return self.waitOutput( verbose ) |
| 388 | else: |
| 389 | warn( '(%s exited - ignoring cmd%s)\n' % ( self, args ) ) |
| 390 | return None |
| 391 | |
| 392 | def cmdPrint( self, *args): |
| 393 | """Call cmd and printing its output |