def wait(self, cmd, raise_on_error=True):
_, stdout, stderr = self.exec_command(cmd)<EOL>stdout.channel.recv_exit_status()<EOL>output = stdout.read()<EOL>if self.interactive:<EOL><INDENT>print(output)<EOL><DEDENT>errors = stderr.read()<EOL>if self.interactive:<EOL><INDENT>print(errors)<EOL><DEDENT>if errors and raise_on_error:<EOL><INDENT>raise ValueError(errors)<EOL><DEDENT>return output<EOL>
Execute command and wait for it to finish. Proceed with caution because
if you run a command that causes a prompt this will hang