Execute a command using popen returns: out, err, exitcode
( self, *args, **kwargs )
| 423 | return popen |
| 424 | |
| 425 | def pexec( self, *args, **kwargs ): |
| 426 | """Execute a command using popen |
| 427 | returns: out, err, exitcode""" |
| 428 | popen = self.popen( *args, stdin=PIPE, stdout=PIPE, stderr=PIPE, |
| 429 | **kwargs ) |
| 430 | # Warning: this can fail with large numbers of fds! |
| 431 | out, err = popen.communicate() |
| 432 | exitcode = popen.wait() |
| 433 | return decode( out ), decode( err ), exitcode |
| 434 | |
| 435 | # Interface management, configuration, and routing |
| 436 |