How to use the aexpect.exceptions.ExpectError function in aexpect

To help you get started, we’ve selected a few aexpect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github avocado-framework / avocado-vt / virttest / virt_vm.py View on Github external
password,
                                            virtio=virtio)
                break
            except remote.LoginError:
                self.verify_alive()
                time.sleep(0.5)
                continue
        else:
            raise remote.LoginTimeoutError('exceeded %s s timeout' %
                                           timeout)
        if restart_network:
            try:
                logging.debug("Attempting to restart guest network")
                os_type = self.params.get('os_type')
                utils_net.restart_guest_network(session, os_type=os_type)
            except (ShellError, ExpectError):
                session.close()
                raise
        return session